-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
38 lines (32 loc) · 842 Bytes
/
types.ts
File metadata and controls
38 lines (32 loc) · 842 Bytes
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
import type {
NodeArray,
SourceFile,
TypeNode,
TypeParameterDeclaration,
TypeReferenceNode,
} from 'typescript';
import type { Service } from 'moleculer';
export type HandlerTypes = {
params?: TypeNode;
returnType?: TypeNode;
typeParameters?: NodeArray<TypeParameterDeclaration>;
};
export type ActionRef = HandlerTypes & {
actionName?: string;
};
export type Imports = Map<string, string>;
export type ImportMapping = Map<TypeReferenceNode, string>;
export type InjectBuiltinFn = (
context: CallWrapperContext,
actions: ActionRef[],
service: Service,
sourceFile: SourceFile,
) => void;
export type CallWrapperContext = {
imports: Imports;
wrapperPath: string;
currentFilePath: string;
importMapping: ImportMapping;
// Builtins to be injected in the parsing process
builtins: InjectBuiltinFn[];
};