Skip to content

Commit a2f4062

Browse files
committed
idea to extend ts
1 parent ba90e05 commit a2f4062

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/services/services.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ namespace ts {
133133

134134
let emptyArray: any[] = [];
135135

136+
// allow augmenting 'extendable parts of compiler & service
137+
export function wrap(method: string, handler: Function) {
138+
extendable[method] = new Proxy(extendable[method], handler);
139+
}
140+
141+
module extendable {
142+
// put extendable methods in here...
143+
}
144+
136145
const jsDocTagNames = [
137146
"augments",
138147
"author",

0 commit comments

Comments
 (0)