mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
simplify API
This commit is contained in:
@@ -265,6 +265,20 @@ export abstract class ExtHostFileSystemEventServiceShape {
|
||||
$onFileEvent(events: FileSystemEvents) { throw ni(); }
|
||||
}
|
||||
|
||||
export interface ObjectIdentifier {
|
||||
$ident: number;
|
||||
}
|
||||
|
||||
export namespace ObjectIdentifier {
|
||||
export function mixin<T>(obj: T, id: number): T & ObjectIdentifier {
|
||||
Object.defineProperty(obj, '$ident', { value: id, enumerable: true });
|
||||
return <T & ObjectIdentifier>obj;
|
||||
}
|
||||
export function get(obj: any): number {
|
||||
return obj['$ident'];
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class ExtHostHeapMonitorShape {
|
||||
$onGarbageCollection(ids: number[]): void { throw ni(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user