Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/scenarios/test-scenario-search/example-files/example.ts
13401 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation and GitHub. All rights reserved.
3
*--------------------------------------------------------------------------------------------*/
4
5
interface MyInterface {
6
id: number;
7
name: string;
8
properties: string[];
9
}
10
11
const myObject: MyInterface = {
12
id: 1,
13
name: 'foo',
14
properties: ['a', 'b', 'c']
15
};
16
17
function getValue(value: keyof MyInterface) {
18
return myObject[value];
19
}
20
21
getValue('id'); // 1
22
23
class Employee {
24
private empCode: number;
25
private empName: string;
26
27
constructor(code: number, name: string) { }
28
29
getSalary(): number {
30
return 10000;
31
}
32
}
33