forked from dsherret/ts-morph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCallSignatureDeclaration.ts
28 lines (25 loc) · 1.25 KB
/
CallSignatureDeclaration.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
import { CallSignatureDeclarationStructure, CallSignatureDeclarationSpecificStructure, StructureKind } from "../../../structures";
import { ts } from "../../../typescript";
import { ChildOrderableNode, JSDocableNode, SignaturedDeclaration, TypeParameteredNode } from "../base";
import { callBaseSet } from "../callBaseSet";
import { TypeElement } from "./TypeElement";
import { callBaseGetStructure } from "../callBaseGetStructure";
export const CallSignatureDeclarationBase = TypeParameteredNode(ChildOrderableNode(JSDocableNode(SignaturedDeclaration(TypeElement))));
export class CallSignatureDeclaration extends CallSignatureDeclarationBase<ts.CallSignatureDeclaration> {
/**
* Sets the node from a structure.
* @param structure - Structure to set the node with.
*/
set(structure: Partial<CallSignatureDeclarationStructure>) {
callBaseSet(CallSignatureDeclarationBase.prototype, this, structure);
return this;
}
/**
* Gets the structure equivalent to this node.
*/
getStructure(): CallSignatureDeclarationStructure {
return callBaseGetStructure<CallSignatureDeclarationSpecificStructure>(CallSignatureDeclarationBase.prototype, this, {
kind: StructureKind.CallSignature
});
}
}