-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
44 lines (37 loc) · 1018 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* auto-generated by NAPI-RS */
/* eslint-disable */
export interface Comment {
start: number
end: number
text: string
}
export const enum FileType {
Client = 'Client',
Server = 'Server',
Isomorphic = 'Isomorphic'
}
export interface ModuleImports {
name: string
}
export function reactServerAction(filePath: string, actionExportPrefix: string, isServerLayer: boolean): Promise<string>
export const enum RSCError {
CannotUseBothClientAndServer = 0,
ServerActionMustBeAsync = 1
}
/**
*
* Validate a file is a valid Server file or Client File
*
* @param code: string - the code to validate
*
* @param file_path: string - the path to the file
*
* @param is_server_layer: boolean - if the file is in the server layer, enable this in server side rendering
*/
export function validate(code: string, filePath: string, isServerLayer: boolean): ValidateResult
export interface ValidateResult {
fileType: FileType
isServerAction: boolean
error?: RSCError
imports: Array<ModuleImports>
}