Files
theia-code-os/examples/api-tests/test-ts-workspace/demo-file.ts
mawkone 8bb5110148
Some checks failed
Playwright Tests / Playwright Tests (ubuntu-22.04, Node.js 22.x) (push) Has been cancelled
3PP License Check / 3PP License Check (11, 22.x, ubuntu-22.04) (push) Has been cancelled
Publish packages to NPM / Perform Publishing (push) Has been cancelled
deploy: current vibn theia state
Made-with: Cursor
2026-02-27 12:01:08 -08:00

33 lines
779 B
TypeScript

interface DemoInterface {
stringField: string;
numberField: number;
doSomething(): number;
}
class DemoClass implements DemoInterface {
stringField: string;
numberField: number;
constructor(someString: string) {
this.stringField = someString;
this.numberField = this.stringField.length;
}
doSomething(): number {
let output = 0;
for (let i = 0; i < this.stringField.length; i++) {
output += this.stringField.charCodeAt(i);
}
return output;
}
}
const demoInstance = new DemoClass('demo');
const demoVariable = demoInstance.stringField;
demoVariable.concat('-string');
import { DefinedInterface } from "./demo-definitions-file";
const bar: DefinedInterface = { coolField: [] };