Skip to content

output declaration type not as expect #29126

@bluelovers

Description

@bluelovers

TypeScript Version: 3.3.0-dev.201xxxxx

Search Terms:

Code

im not sure whats wrong

init.ts

import { loadCacheConfig, loadMainConfig, loadConfig } from '@node-novel/task/lib/config';

export let CacheConfig = loadCacheConfig(PROJECT_ROOT);

export let CLONE_DEPTH = process.env.CLONE_DEPTH || 50;

@node-novel/task/lib/config

import { IConfig } from '../index';
export declare function loadMainConfig(cwd?: string): {
    config: IConfig;
    filepath: string;
};
export declare function loadCacheConfig(cwd?: string): {
    config: {
        last: string | number;
        last_from?: string | number;
        done?: number;
        last_push_head?: string;
    };
    filepath: string;
};
export declare function transform(result: any): any;
export declare function loadConfig<T>(name: string, options?: any): {
    config: T;
    filepath: string;
};
export default loadConfig;

Expected behavior:

init.d.ts

export declare let CacheConfig: {
    config: {
        last: string | number;
        last_from?: string | number;
        done?: number;
        last_push_head?: string;
    };
    filepath: string;
};

export declare let CLONE_DEPTH: string | number;

Actual behavior:

init.d.ts

export declare let CacheConfig: {
    config: {
        last: import("node-novel-info").INumber;
        last_from?: import("node-novel-info").INumber;
        done?: number;
        last_push_head?: string;
    };
    filepath: string;
};

export declare let CLONE_DEPTH: import("node-novel-info").INumber;

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions