|
3 | 3 |
|
4 | 4 | /* auto-generated by NAPI-RS */
|
5 | 5 |
|
6 |
| -export declare function findAncestorFile(filenames: Array<string>, from: string, root: string): string | null |
7 |
| -export declare function findFirstFile(names: Array<string>): string | null |
8 |
| -export declare function findNodeModule(module: string, from: string): string | null |
9 |
| -export declare function hashString(s: string): string |
10 |
| -export declare function hashBuffer(buf: Buffer): string |
11 |
| -export declare function optimizeImage(kind: string, buf: Buffer): Buffer |
12 |
| -export declare function transformHtml(opts: object): unknown |
13 |
| -export declare function packageHtml(opts: object): unknown |
14 |
| -export declare function optimizeHtml(opts: object): unknown |
15 |
| -export declare function transformSvg(opts: object): unknown |
16 |
| -export declare function packageSvg(opts: object): unknown |
17 |
| -export declare function optimizeSvg(opts: object): unknown |
18 |
| -export declare function svgReact(opts: object): unknown |
| 6 | +export interface JsMacroError { |
| 7 | + kind: number; |
| 8 | + message: string; |
| 9 | +} |
| 10 | +export declare function findAncestorFile( |
| 11 | + filenames: Array<string>, |
| 12 | + from: string, |
| 13 | + root: string, |
| 14 | +): string | null; |
| 15 | +export declare function findFirstFile(names: Array<string>): string | null; |
| 16 | +export declare function findNodeModule( |
| 17 | + module: string, |
| 18 | + from: string, |
| 19 | +): string | null; |
| 20 | +export declare function hashString(s: string): string; |
| 21 | +export declare function hashBuffer(buf: Buffer): string; |
| 22 | +export declare function optimizeImage(kind: string, buf: Buffer): Buffer; |
| 23 | +export declare function transformHtml(opts: object): unknown; |
| 24 | +export declare function packageHtml(opts: object): unknown; |
| 25 | +export declare function optimizeHtml(opts: object): unknown; |
| 26 | +export declare function transformSvg(opts: object): unknown; |
| 27 | +export declare function packageSvg(opts: object): unknown; |
| 28 | +export declare function optimizeSvg(opts: object): unknown; |
| 29 | +export declare function svgReact(opts: object): unknown; |
19 | 30 | export interface JsFileSystemOptions {
|
20 |
| - read: (...args: any[]) => any |
21 |
| - readLink: (...args: any[]) => any |
22 |
| - kind: (...args: any[]) => any |
23 |
| - includeNodeModules?: NapiSideEffectsVariants |
| 31 | + read: (...args: any[]) => any; |
| 32 | + readLink: (...args: any[]) => any; |
| 33 | + kind: (...args: any[]) => any; |
| 34 | + includeNodeModules?: NapiSideEffectsVariants; |
24 | 35 | }
|
25 | 36 | export interface FileSystem {
|
26 |
| - fs?: JsFileSystemOptions |
27 |
| - includeNodeModules?: NapiSideEffectsVariants |
28 |
| - conditions?: number |
29 |
| - moduleDirResolver?: (...args: any[]) => any |
30 |
| - mode: number |
31 |
| - entries?: number |
32 |
| - extensions?: Array<string> |
33 |
| - packageExports: boolean |
34 |
| - typescript?: boolean |
| 37 | + fs?: JsFileSystemOptions; |
| 38 | + includeNodeModules?: NapiSideEffectsVariants; |
| 39 | + conditions?: number; |
| 40 | + moduleDirResolver?: (...args: any[]) => any; |
| 41 | + mode: number; |
| 42 | + entries?: number; |
| 43 | + extensions?: Array<string>; |
| 44 | + packageExports: boolean; |
| 45 | + typescript?: boolean; |
35 | 46 | }
|
36 | 47 | export interface ResolveOptions {
|
37 |
| - filename: string |
38 |
| - specifierType: string |
39 |
| - parent: string |
40 |
| - packageConditions?: Array<string> |
| 48 | + filename: string; |
| 49 | + specifierType: string; |
| 50 | + parent: string; |
| 51 | + packageConditions?: Array<string>; |
41 | 52 | }
|
42 | 53 | export interface FilePathCreateInvalidation {
|
43 |
| - filePath: string |
| 54 | + filePath: string; |
44 | 55 | }
|
45 | 56 | export interface FileNameCreateInvalidation {
|
46 |
| - fileName: string |
47 |
| - aboveFilePath: string |
| 57 | + fileName: string; |
| 58 | + aboveFilePath: string; |
48 | 59 | }
|
49 | 60 | export interface GlobCreateInvalidation {
|
50 |
| - glob: string |
| 61 | + glob: string; |
51 | 62 | }
|
52 | 63 | export interface ResolveResult {
|
53 |
| - resolution: unknown |
54 |
| - invalidateOnFileChange: Array<string> |
55 |
| - invalidateOnFileCreate: Array<FilePathCreateInvalidation | FileNameCreateInvalidation | GlobCreateInvalidation> |
56 |
| - query?: string |
57 |
| - sideEffects: boolean |
58 |
| - error: unknown |
59 |
| - moduleType: number |
| 64 | + resolution: unknown; |
| 65 | + invalidateOnFileChange: Array<string>; |
| 66 | + invalidateOnFileCreate: Array< |
| 67 | + | FilePathCreateInvalidation |
| 68 | + | FileNameCreateInvalidation |
| 69 | + | GlobCreateInvalidation |
| 70 | + >; |
| 71 | + query?: string; |
| 72 | + sideEffects: boolean; |
| 73 | + error: unknown; |
| 74 | + moduleType: number; |
60 | 75 | }
|
61 | 76 | export interface JsInvalidations {
|
62 |
| - invalidateOnFileChange: Array<string> |
63 |
| - invalidateOnFileCreate: Array<FilePathCreateInvalidation | FileNameCreateInvalidation | GlobCreateInvalidation> |
64 |
| - invalidateOnStartup: boolean |
| 77 | + invalidateOnFileChange: Array<string>; |
| 78 | + invalidateOnFileCreate: Array< |
| 79 | + | FilePathCreateInvalidation |
| 80 | + | FileNameCreateInvalidation |
| 81 | + | GlobCreateInvalidation |
| 82 | + >; |
| 83 | + invalidateOnStartup: boolean; |
65 | 84 | }
|
66 |
| -export declare function transform(opts: object): unknown |
67 |
| -export declare function transformAsync(opts: object): object |
| 85 | +export declare function transform(opts: object): unknown; |
| 86 | +export declare function transformAsync(opts: object): object; |
68 | 87 | export declare class Hash {
|
69 |
| - constructor() |
70 |
| - writeString(s: string): void |
71 |
| - writeBuffer(buf: Buffer): void |
72 |
| - finish(): string |
| 88 | + constructor(); |
| 89 | + writeString(s: string): void; |
| 90 | + writeBuffer(buf: Buffer): void; |
| 91 | + finish(): string; |
73 | 92 | }
|
74 | 93 | export declare class Resolver {
|
75 |
| - constructor(projectRoot: string, options: FileSystem) |
76 |
| - resolve(options: ResolveOptions): ResolveResult |
77 |
| - resolveAsync(): object |
78 |
| - resolveAsync(options: ResolveOptions): object |
79 |
| - getInvalidations(path: string): JsInvalidations |
80 |
| - getInvalidations(path: string): JsInvalidations |
| 94 | + constructor(projectRoot: string, options: FileSystem); |
| 95 | + resolve(options: ResolveOptions): ResolveResult; |
| 96 | + resolveAsync(): object; |
| 97 | + resolveAsync(options: ResolveOptions): object; |
| 98 | + getInvalidations(path: string): JsInvalidations; |
| 99 | + getInvalidations(path: string): JsInvalidations; |
81 | 100 | }
|
0 commit comments