Skip to content

Commit 667d866

Browse files
committed
fix: ts definition
1 parent 667c127 commit 667d866

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

index.d.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1+
declare module 'postcss-import-resolver' {
2+
interface AliasItem {
3+
alias: string;
4+
name: string;
5+
onlyModule?: boolean;
6+
}
17

2-
import { ResolverFactory } from 'enhanced-resolve'
8+
interface Dictionary<T> {
9+
[key: string]: T;
10+
}
311

4-
declare function resolver(config: ResolverFactory.ResolverOption): Function;
12+
interface Plugin {
13+
apply(...args: any[]): void;
14+
}
515

6-
declare module 'postcss-import-resolver' {
7-
export = resolver;
16+
interface ResolverOption {
17+
alias?: AliasItem[] | Dictionary<string>;
18+
aliasFields?: string[];
19+
cachePredicate?: (val: Object) => boolean;
20+
descriptionFiles?: string[];
21+
enforceExtension?: boolean;
22+
enforceModuleExtension?: boolean;
23+
extensions?: string[];
24+
fileSystem?: Object;
25+
mainFields?: string[];
26+
mainFiles?: string[];
27+
moduleExtensions?: string[];
28+
modules?: string[];
29+
plugins?: Plugin[];
30+
resolver?: Object;
31+
resolveToContext?: boolean;
32+
symlinks?: string[] | boolean;
33+
unsafeCache?: boolean | Dictionary<any>;
34+
useSyncFileSystemCalls?: boolean;
35+
}
36+
37+
export default function resolver(config: ResolverOption): Function
838
}

0 commit comments

Comments
 (0)