type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(line: string, hasEOL: boolean, state: languages.IState): languages.EncodedTokenizationResult => { let tokens = _tokens[_lineIndex++]; let result = new Uint32Array(2 * tokens.length); for (let i = 0; i < tokens.length; i++) { result[2 * i] = tokens[i].startIndex; result[2 * i + 1] = ( tokens[i].value << MetadataConsts.FOREGROUND_OFFSET ); } return new languages.EncodedTokenizationResult(result, state); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
() => { model.dispose(); languageRegistration.dispose(); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
() => { withSplitLinesCollection(model, 'off', 0, (splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 8); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nice {', minColumn: 1, maxColumn: 13, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 10, value: 3 }, { endIndex: 12, value: 4 }, ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello world");', minColumn: 1, maxColumn: 30, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 27, value: 15 }, { endIndex: 29, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello world, this is a somewhat longer line");', minColumn: 1, maxColumn: 62, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 59, value: 28 }, { endIndex: 61, value: 29 }, ] }, { minColumn: 1, maxColumn: 3, content: ' }', tokens: [ { endIndex: 2, value: 30 }, ] }, { minColumn: 1, maxColumn: 2, content: '}', tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], ]); splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.strictEqual(splitLinesCollection.getViewLineCount(), 5); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[4], _expected[5], _expected[6], _expected[7], ]); }); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 8); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nice {', minColumn: 1, maxColumn: 13, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 10, value: 3 }, { endIndex: 12, value: 4 }, ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello world");', minColumn: 1, maxColumn: 30, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 27, value: 15 }, { endIndex: 29, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello world, this is a somewhat longer line");', minColumn: 1, maxColumn: 62, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 59, value: 28 }, { endIndex: 61, value: 29 }, ] }, { minColumn: 1, maxColumn: 3, content: ' }', tokens: [ { endIndex: 2, value: 30 }, ] }, { minColumn: 1, maxColumn: 2, content: '}', tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], ]); splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.strictEqual(splitLinesCollection.getViewLineCount(), 5); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[4], _expected[5], _expected[6], _expected[7], ]); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
() => { withSplitLinesCollection(model, 'wordWrapColumn', 30, (splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 12); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nice {', minColumn: 1, maxColumn: 13, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 10, value: 3 }, { endIndex: 12, value: 4 }, ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 21, value: 15 }, ] }, { content: ' world");', minColumn: 13, maxColumn: 21, tokens: [ { endIndex: 18, value: 15 }, { endIndex: 20, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 21, value: 28 }, ] }, { content: ' world, this is a ', minColumn: 13, maxColumn: 30, tokens: [ { endIndex: 29, value: 28 }, ] }, { content: ' somewhat longer ', minColumn: 13, maxColumn: 29, tokens: [ { endIndex: 28, value: 28 }, ] }, { content: ' line");', minColumn: 13, maxColumn: 20, tokens: [ { endIndex: 17, value: 28 }, { endIndex: 19, value: 29 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 30 }, ] }, { content: '}', minColumn: 1, maxColumn: 2, tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.strictEqual(splitLinesCollection.getViewLineCount(), 8); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); }); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 12); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nice {', minColumn: 1, maxColumn: 13, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 10, value: 3 }, { endIndex: 12, value: 4 }, ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 21, value: 15 }, ] }, { content: ' world");', minColumn: 13, maxColumn: 21, tokens: [ { endIndex: 18, value: 15 }, { endIndex: 20, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 21, value: 28 }, ] }, { content: ' world, this is a ', minColumn: 13, maxColumn: 30, tokens: [ { endIndex: 29, value: 28 }, ] }, { content: ' somewhat longer ', minColumn: 13, maxColumn: 29, tokens: [ { endIndex: 28, value: 28 }, ] }, { content: ' line");', minColumn: 13, maxColumn: 20, tokens: [ { endIndex: 17, value: 28 }, { endIndex: 19, value: 29 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 30 }, ] }, { content: '}', minColumn: 1, maxColumn: 2, tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); splitLinesCollection.setHiddenAreas([new Range(2, 1, 4, 1)]); assert.strictEqual(splitLinesCollection.getViewLineCount(), 8); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(1, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(2, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(3, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(4, 1), false); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(5, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(6, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(7, 1), true); assert.strictEqual(splitLinesCollection.modelPositionIsVisible(8, 1), true); assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
() => { model.deltaDecorations([], [{ range: new Range(1, 9, 1, 9), options: { description: 'example', after: { content: 'very very long injected text that causes a line break', inlineClassName: 'myClassName' }, showIfCollapsed: true, } }]); withSplitLinesCollection(model, 'wordWrapColumn', 30, (splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 14); assert.strictEqual(splitLinesCollection.getViewLineMaxColumn(1), 24); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nivery very long ', minColumn: 1, maxColumn: 24, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 8, value: 3 }, { endIndex: 23, value: 1 }, ] }, { content: ' injected text that causes ', minColumn: 5, maxColumn: 31, tokens: [{ endIndex: 30, value: 1 }] }, { content: ' a line breakce {', minColumn: 5, maxColumn: 21, tokens: [ { endIndex: 16, value: 1 }, { endIndex: 18, value: 3 }, { endIndex: 20, value: 4 } ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 21, value: 15 }, ] }, { content: ' world");', minColumn: 13, maxColumn: 21, tokens: [ { endIndex: 18, value: 15 }, { endIndex: 20, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 21, value: 28 }, ] }, { content: ' world, this is a ', minColumn: 13, maxColumn: 30, tokens: [ { endIndex: 29, value: 28 }, ] }, { content: ' somewhat longer ', minColumn: 13, maxColumn: 29, tokens: [ { endIndex: 28, value: 28 }, ] }, { content: ' line");', minColumn: 13, maxColumn: 20, tokens: [ { endIndex: 17, value: 28 }, { endIndex: 19, value: 29 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 30 }, ] }, { content: '}', minColumn: 1, maxColumn: 2, tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); const data = splitLinesCollection.getViewLinesData(1, 14, new Array(14).fill(true)); assert.deepStrictEqual( data.map((d) => ({ inlineDecorations: d.inlineDecorations?.map((d) => ({ startOffset: d.startOffset, endOffset: d.endOffset, })), })), [ { inlineDecorations: [{ startOffset: 8, endOffset: 23 }] }, { inlineDecorations: [{ startOffset: 4, endOffset: 42 }] }, { inlineDecorations: [{ startOffset: 4, endOffset: 16 }] }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, ] ); }); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(splitLinesCollection) => { assert.strictEqual(splitLinesCollection.getViewLineCount(), 14); assert.strictEqual(splitLinesCollection.getViewLineMaxColumn(1), 24); let _expected: ITestMinimapLineRenderingData[] = [ { content: 'class Nivery very long ', minColumn: 1, maxColumn: 24, tokens: [ { endIndex: 5, value: 1 }, { endIndex: 6, value: 2 }, { endIndex: 8, value: 3 }, { endIndex: 23, value: 1 }, ] }, { content: ' injected text that causes ', minColumn: 5, maxColumn: 31, tokens: [{ endIndex: 30, value: 1 }] }, { content: ' a line breakce {', minColumn: 5, maxColumn: 21, tokens: [ { endIndex: 16, value: 1 }, { endIndex: 18, value: 3 }, { endIndex: 20, value: 4 } ] }, { content: ' function hi() {', minColumn: 1, maxColumn: 17, tokens: [ { endIndex: 1, value: 5 }, { endIndex: 9, value: 6 }, { endIndex: 10, value: 7 }, { endIndex: 12, value: 8 }, { endIndex: 16, value: 9 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 10 }, { endIndex: 9, value: 11 }, { endIndex: 10, value: 12 }, { endIndex: 13, value: 13 }, { endIndex: 14, value: 14 }, { endIndex: 21, value: 15 }, ] }, { content: ' world");', minColumn: 13, maxColumn: 21, tokens: [ { endIndex: 18, value: 15 }, { endIndex: 20, value: 16 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 17 }, ] }, { content: ' function hello() {', minColumn: 1, maxColumn: 20, tokens: [ { endIndex: 1, value: 18 }, { endIndex: 9, value: 19 }, { endIndex: 10, value: 20 }, { endIndex: 15, value: 21 }, { endIndex: 19, value: 22 }, ] }, { content: ' console.log("Hello ', minColumn: 1, maxColumn: 22, tokens: [ { endIndex: 2, value: 23 }, { endIndex: 9, value: 24 }, { endIndex: 10, value: 25 }, { endIndex: 13, value: 26 }, { endIndex: 14, value: 27 }, { endIndex: 21, value: 28 }, ] }, { content: ' world, this is a ', minColumn: 13, maxColumn: 30, tokens: [ { endIndex: 29, value: 28 }, ] }, { content: ' somewhat longer ', minColumn: 13, maxColumn: 29, tokens: [ { endIndex: 28, value: 28 }, ] }, { content: ' line");', minColumn: 13, maxColumn: 20, tokens: [ { endIndex: 17, value: 28 }, { endIndex: 19, value: 29 }, ] }, { content: ' }', minColumn: 1, maxColumn: 3, tokens: [ { endIndex: 2, value: 30 }, ] }, { content: '}', minColumn: 1, maxColumn: 2, tokens: [ { endIndex: 1, value: 31 }, ] } ]; assertAllMinimapLinesRenderingData(splitLinesCollection, [ _expected[0], _expected[1], _expected[2], _expected[3], _expected[4], _expected[5], _expected[6], _expected[7], _expected[8], _expected[9], _expected[10], _expected[11], ]); const data = splitLinesCollection.getViewLinesData(1, 14, new Array(14).fill(true)); assert.deepStrictEqual( data.map((d) => ({ inlineDecorations: d.inlineDecorations?.map((d) => ({ startOffset: d.startOffset, endOffset: d.endOffset, })), })), [ { inlineDecorations: [{ startOffset: 8, endOffset: 23 }] }, { inlineDecorations: [{ startOffset: 4, endOffset: 42 }] }, { inlineDecorations: [{ startOffset: 4, endOffset: 16 }] }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, { inlineDecorations: undefined }, ] ); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(d) => ({ inlineDecorations: d.inlineDecorations?.map((d) => ({ startOffset: d.startOffset, endOffset: d.endOffset, })), })
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(d) => ({ startOffset: d.startOffset, endOffset: d.endOffset, })
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(lineNumber: number) => { return null!; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(lineNumber: number) => { return text; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(lineNumber: number) => { return text.length; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(lineNumber: number) => { return 1; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(lineNumber: number) => { return text.length + 1; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ArrowFunction
(range: IRange, eol?: EndOfLinePreference) => { return text.substring(range.startColumn - 1, range.endColumn - 1); }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
InterfaceDeclaration
interface ITestViewLineToken { endIndex: number; value: number; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
InterfaceDeclaration
interface ITestMinimapLineRenderingData { content: string; minColumn: number; maxColumn: number; tokens: ITestViewLineToken[]; }
Fevre81/vscode
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
TypeScript
ClassDeclaration
// export namespace jda.test.tutorialNetwork{ export class Commodity extends Asset { tradingSymbol: string; description: string; mainExchange: string; quantity: number; owner: Trader; }
KranthiRemala/jplan
basic-ui/src/app/jda.test.tutorialNetwork.ts
TypeScript
ClassDeclaration
export class Trader extends Participant { tradeId: string; firstName: string; lastName: string; }
KranthiRemala/jplan
basic-ui/src/app/jda.test.tutorialNetwork.ts
TypeScript
ClassDeclaration
export class Trade extends Transaction { commodity: Commodity; newOwner: Trader; }
KranthiRemala/jplan
basic-ui/src/app/jda.test.tutorialNetwork.ts
TypeScript
FunctionDeclaration
export default function getUserFoodFromBank( userBank: O.Readonly<ItemBank>, totalHealingNeeded: number ): false | ItemBank { let totalHealingCalc = totalHealingNeeded; let foodToRemove: ItemBank = {}; // Gets all the eatables in the user bank for (const eatable of Eatables.sort((i, j) => (i.healAmount > j.healAmount ? 1 : -1))) { const inBank = userBank[eatable.id]; const toRemove = Math.ceil(totalHealingCalc / eatable.healAmount); if (!inBank) continue; if (inBank >= toRemove) { totalHealingCalc -= Math.ceil(eatable.healAmount * toRemove); foodToRemove = addBanks([foodToRemove, { [eatable.id]: toRemove }]); break; } else { totalHealingCalc -= Math.ceil(eatable.healAmount * inBank); foodToRemove = addBanks([foodToRemove, { [eatable.id]: inBank }]); } } // Check if qty is still above 0. If it is, it means the user doesn't have enough food. if (totalHealingCalc > 0) return false; return foodToRemove; }
Reldasss/RSRSTEST
src/lib/minions/functions/getUserFoodFromBank.ts
TypeScript
ArrowFunction
(i, j) => (i.healAmount > j.healAmount ? 1 : -1)
Reldasss/RSRSTEST
src/lib/minions/functions/getUserFoodFromBank.ts
TypeScript
ClassDeclaration
export class AddWordListPage { navigateTo() { return cy.visit('/packs/604cdf3c8d7aeecae7797435/new'); } getTitle() { return cy.get('.add-wl-title'); } addWordListButton() { return cy.get('[data-test=addWlButton]'); } selectMatSelectValue(select: Cypress.Chainable, value: string) { // Find and click the drop down return select.click() // Select and click the desired value from the resulting menu .get(`mat-option[value="${value}"]`).click(); } getFormField(fieldName: string) { return cy.get(`mat-form-field [formcontrolname=${(fieldName)}]`); } addWordList(newWordList: WordList) { this.getFormField('name').type(newWordList.name); this.selectMatSelectValue(this.getFormField('enabled'), newWordList.enabled.toString()); return this.addWordListButton().click(); } }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
navigateTo() { return cy.visit('/packs/604cdf3c8d7aeecae7797435/new'); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
getTitle() { return cy.get('.add-wl-title'); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
addWordListButton() { return cy.get('[data-test=addWlButton]'); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
selectMatSelectValue(select: Cypress.Chainable, value: string) { // Find and click the drop down return select.click() // Select and click the desired value from the resulting menu .get(`mat-option[value="${value}"]`).click(); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
getFormField(fieldName: string) { return cy.get(`mat-form-field [formcontrolname=${(fieldName)}]`); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
MethodDeclaration
addWordList(newWordList: WordList) { this.getFormField('name').type(newWordList.name); this.selectMatSelectValue(this.getFormField('enabled'), newWordList.enabled.toString()); return this.addWordListButton().click(); }
UMM-CSci-3601-S21/it-1-climate
client/cypress/support/add-wl.po.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title = 'OpenApps'; }
theokyr/OpenApps
src/app/app.component.ts
TypeScript
ClassDeclaration
export class Disconnect extends BaseComponent { public eventType: string = CallNotification.Connect public method: string = CallMethod.Disconnect public controlId: string = this.call.tag get payload(): any { return { node_id: this.call.nodeId, call_id: this.call.id } } notificationHandler(params: any): void { this.state = params.connect_state this.completed = this.state !== CallConnectState.Connecting if (this.completed) { this.successful = this.state === CallConnectState.Disconnected this.event = new Event(this.state, params) } if (this._hasBlocker() && this._eventsToWait.includes(this.state)) { this.blocker.resolve() } } }
Robokishan/signalwire-node
packages/common/src/relay/calling/components/Disconnect.ts
TypeScript
MethodDeclaration
notificationHandler(params: any): void { this.state = params.connect_state this.completed = this.state !== CallConnectState.Connecting if (this.completed) { this.successful = this.state === CallConnectState.Disconnected this.event = new Event(this.state, params) } if (this._hasBlocker() && this._eventsToWait.includes(this.state)) { this.blocker.resolve() } }
Robokishan/signalwire-node
packages/common/src/relay/calling/components/Disconnect.ts
TypeScript
ArrowFunction
({ checked = false, onChange, onClicked, name, activeIcon = 'checked', checkedColor = '#1989fa', labelText, inactiveIcon = 'passed', disabled, labelDisabled, isActive }: IProps) => { const [isChecked, handleCheck] = useState(checked); const handleClick = (e) => { return onClicked && onClicked(e); }; useEffect(() => { return onChange && onChange(isChecked); }, [isChecked]); useEffect(() => { isActive ? handleCheck(true) : handleCheck(false); }, [isActive]); const handleContainerClick = (e) => { e.preventDefault(); if (!disabled && !labelDisabled) { handleCheck(!isChecked); handleClick(e); } }; const handleIconClick = (e) => { e.preventDefault(); if (!disabled) { handleCheck(!isChecked); handleClick(e); } }; const iconName = isChecked ? activeIcon : inactiveIcon; const iconColor = disabled ? '#c8c9cc' : checkedColor; return ( <div className={classnames(baseClass, [ { disabled } ])} onClick={handleContainerClick} > <div className={`${baseClass}__icon-container`} onClick={handleIconClick}> <Icon color={iconColor} name={iconName} size='20px' /> </div> <label htmlFor={name}>{labelText}</label> </div>
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
(e) => { return onClicked && onClicked(e); }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
() => { return onChange && onChange(isChecked); }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
() => { isActive ? handleCheck(true) : handleCheck(false); }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
(e) => { e.preventDefault(); if (!disabled && !labelDisabled) { handleCheck(!isChecked); handleClick(e); } }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
(e) => { e.preventDefault(); if (!disabled) { handleCheck(!isChecked); handleClick(e); } }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
InterfaceDeclaration
export interface IProps { checked?: boolean; name?: string; activeIcon?: string; inactiveIcon?: string; checkedColor?: string; labelText?: string; disabled?: boolean; labelDisabled?: boolean; isActive?: boolean; onChange?: Function; onClicked?: Function; }
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
MethodDeclaration
classnames(baseClass, [ { disabled } ])
flynn-eye/vant-react
src/components/Checkbox/index.tsx
TypeScript
ArrowFunction
(retryOptions: IRetryOptions) => { const promiseCache = new Map(); return (fn: (...args) => Promise<any>) => (...args) => { const key = JSON.stringify(args); if (promiseCache.has(key)) { return promiseCache.get(key); } const promise = retry(() => fn(...args), retryOptions); promiseCache.set(key, promise); return promise; }; }
cyber-eternal/binance-trading-server
src/common/lib/amqp/async-cache-and-retry.ts
TypeScript
ArrowFunction
(fn: (...args) => Promise<any>) => (...args) => { const key = JSON.stringify(args); if (promiseCache.has(key)) { return promiseCache.get(key); } const promise = retry(() => fn(...args), retryOptions); promiseCache.set(key, promise); return promise; }
cyber-eternal/binance-trading-server
src/common/lib/amqp/async-cache-and-retry.ts
TypeScript
ArrowFunction
(...args) => { const key = JSON.stringify(args); if (promiseCache.has(key)) { return promiseCache.get(key); } const promise = retry(() => fn(...args), retryOptions); promiseCache.set(key, promise); return promise; }
cyber-eternal/binance-trading-server
src/common/lib/amqp/async-cache-and-retry.ts
TypeScript
ArrowFunction
() => fn(...args)
cyber-eternal/binance-trading-server
src/common/lib/amqp/async-cache-and-retry.ts
TypeScript
InterfaceDeclaration
interface IRetryOptions { retries?: number; factor?: number; minTimeout?: number; maxTimeout?: number; randomize?: boolean; }
cyber-eternal/binance-trading-server
src/common/lib/amqp/async-cache-and-retry.ts
TypeScript
ArrowFunction
(result: { teams: Team[] }) => { const teams: Array<SelectableValue<Team>> = result.teams.map((team) => { return { value: team, label: team.name, imgUrl: team.avatarUrl, }; }); this.setState({ isLoading: false }); return teams; }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
ArrowFunction
(team) => { return { value: team, label: team.name, imgUrl: team.avatarUrl, }; }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
ClassDeclaration
export class TeamPicker extends Component<Props, State> { debouncedSearch: any; constructor(props: Props) { super(props); this.state = { isLoading: false }; this.search = this.search.bind(this); this.debouncedSearch = debounce(this.search, 300, { leading: true, trailing: true, }); } search(query?: string) { this.setState({ isLoading: true }); if (isNil(query)) { query = ''; } return getBackendSrv() .get(`/api/teams/search?perpage=100&page=1&query=${query}`) .then((result: { teams: Team[] }) => { const teams: Array<SelectableValue<Team>> = result.teams.map((team) => { return { value: team, label: team.name, imgUrl: team.avatarUrl, }; }); this.setState({ isLoading: false }); return teams; }); } render() { const { onSelected, className } = this.props; const { isLoading } = this.state; return ( <div className="user-picker" data-testid="teamPicker"> <AsyncSelect menuShouldPortal isLoading={isLoading} defaultOptions={true} loadOptions={this.debouncedSearch} onChange={onSelected} className={className} placeholder="Select a team" noOptionsMessage="No teams found" aria-label="Team picker" /> </div> ); } }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
InterfaceDeclaration
export interface Props { onSelected: (team: SelectableValue<Team>) => void; className?: string; }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
InterfaceDeclaration
export interface State { isLoading: boolean; }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
MethodDeclaration
search(query?: string) { this.setState({ isLoading: true }); if (isNil(query)) { query = ''; } return getBackendSrv() .get(`/api/teams/search?perpage=100&page=1&query=${query}`) .then((result: { teams: Team[] }) => { const teams: Array<SelectableValue<Team>> = result.teams.map((team) => { return { value: team, label: team.name, imgUrl: team.avatarUrl, }; }); this.setState({ isLoading: false }); return teams; }); }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
MethodDeclaration
render() { const { onSelected, className } = this.props; const { isLoading } = this.state; return ( <div className="user-picker" data-testid="teamPicker"> <AsyncSelect menuShouldPortal isLoading={isLoading} defaultOptions={true} loadOptions={this.debouncedSearch} onChange={onSelected} className={className} placeholder="Select a team" noOptionsMessage="No teams found" aria-label="Team picker" /> </div> ); }
axinoss/grafana
public/app/core/components/Select/TeamPicker.tsx
TypeScript
FunctionDeclaration
export function createPopulateOmniboxEventArgs( queryboxContent: string, cursorPosition: number, rows: IOmniboxDataRow[] = [] ): IPopulateOmniboxEventArgs { return { completeQueryExpression: { word: queryboxContent, regex: new RegExp(queryboxContent, "gi") }, allQueryExpressions: undefined, currentQueryExpression: { word: queryboxContent, regex: new RegExp(queryboxContent, "gi") }, cursorPosition: cursorPosition, rows: [], clear: () => {}, clearCurrentExpression: () => {}, closeOmnibox: () => {}, insertAt: () => {}, replace: () => {}, replaceCurrentExpression: () => {} }; }
futurename/pokemon_challenge
node_modules/coveo-search-ui-tests/src/Fake/FakeEventArgs.ts
TypeScript
ClassDeclaration
@Component({ selector: 'gj-activity-feed-notification', template, }) export class NotificationComponent { @Input( '<' ) item: ActivityFeedItem; @Output() onClick: Function; notification: Notification; // We bind-once canToggleContent. It needs to be undefined so that it // doesn't bind until we know if the content can be toggled. canToggleContent: boolean | undefined = undefined; showFullContent = false; constructor( @Inject( 'Notification' ) public notificationModel: typeof Notification, @Inject( 'Screen' ) public screen: Screen ) { this.notification = this.item.feedItem as Notification; } go( $event: ng.IAngularEvent ) { if ( $event.stopPropagation ) { $event.stopPropagation(); $event.preventDefault(); } this.notification.go(); this.onClick(); } toggleFull() { this.showFullContent = !this.showFullContent; } }
Fappp/Gamejolt
src/app/components/activity/feed/notification/notification-directive.ts
TypeScript
MethodDeclaration
go( $event: ng.IAngularEvent ) { if ( $event.stopPropagation ) { $event.stopPropagation(); $event.preventDefault(); } this.notification.go(); this.onClick(); }
Fappp/Gamejolt
src/app/components/activity/feed/notification/notification-directive.ts
TypeScript
MethodDeclaration
toggleFull() { this.showFullContent = !this.showFullContent; }
Fappp/Gamejolt
src/app/components/activity/feed/notification/notification-directive.ts
TypeScript
ArrowFunction
() => { interface Props extends be.withColorContext.Props { foo: string; } const Component = ({ colors, foo }: Props) => ( <div> <h1>Color list</h1> <ul> {colors.map((c, i) => ( <li key={i}>{c.color}</li> ))} </ul> {foo} </div> ); const Enhanced = be.withColorContext(Component); <Enhanced foo="bar" />; <Enhanced foo="bar" disableCustomColors />; }
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
({ colors, foo }: Props) => ( <div> <h1>Color
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
(c, i) => ( <li key={i}>{c.color}</li>
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
() => <h1>Hello
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
item => console.log(item.id)
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
i => i.id
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
media => console.log('selected ' + media.id)
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
m => m.id
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
b => console.log(b.clientId)
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
() => void 0
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
InterfaceDeclaration
interface Props extends be.withColorContext.Props { foo: string; }
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
MethodDeclaration
onClick() {}
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
MethodDeclaration
onChange(color) { color && console.log(color.name); }
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
MethodDeclaration
onClick() { console.log('foo'); }
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
MethodDeclaration
onClick() { console.log('bar'); }
ChrisZieba/DefinitelyTyped
types/wordpress__block-editor/wordpress__block-editor-tests.tsx
TypeScript
ArrowFunction
props => { const { title, children, style, className = '' } = props; const { mode } = useContext<ContextType>(context); const state = useReactive({ flag: false, }); const classMenu = classNames(prefix, { [`${prefix}-${mode}`]: true, [className]: true, }); const classTitle = classNames(`${prefix}-title`, { [`${prefix}-title-${mode}`]: true, [`${prefix}-title-inline-active`]: state.flag, }); return ( <li className={classMenu} style={style} onClick={()
wen-haoming/React-UI-library
packages/mui/src/menu/SubMenu.tsx
TypeScript
InterfaceDeclaration
export interface SubMenuProps extends baseProps { title: string; }
wen-haoming/React-UI-library
packages/mui/src/menu/SubMenu.tsx
TypeScript
ArrowFunction
() => Link
Fuglar-ehf/island.is
libs/api/domains/cms/src/lib/models/oneColumnText.model.ts
TypeScript
ArrowFunction
() => [SliceUnion]
Fuglar-ehf/island.is
libs/api/domains/cms/src/lib/models/oneColumnText.model.ts
TypeScript
ArrowFunction
({ sys, fields, }: IOneColumnText): SystemMetadata<OneColumnText> => ({ typename: 'OneColumnText', id: sys.id, title: fields.title ?? '', link: fields.link ? mapLink(fields.link) : null, content: fields.content ? mapDocument(fields.content, sys.id + ':content') : [], })
Fuglar-ehf/island.is
libs/api/domains/cms/src/lib/models/oneColumnText.model.ts
TypeScript
ClassDeclaration
@ObjectType() export class OneColumnText { @Field(() => ID) id!: string @Field() title!: string @Field(() => Link, { nullable: true }) link?: Link | null @Field(() => [SliceUnion], { nullable: true }) content?: Array<typeof SliceUnion> }
Fuglar-ehf/island.is
libs/api/domains/cms/src/lib/models/oneColumnText.model.ts
TypeScript
ClassDeclaration
/** * Basic storage container for a single Thing to be stored in an Area's * PreThings member. A PreThing stores an actual Thing along with basic * sizing and positioning information, so that a MapsHandler may accurately * spawn or unspawn it as needed. */ export class PreThing implements IPreThing { /** * The contained Thing to be placed during gameplay. */ public thing: IThing; /** * A copy of the Thing's title. */ public title: any; /** * The creation command used to create the Thing. */ public reference: any; /** * Whether this PreThing has already spawned (initially false). */ public spawned: boolean; /** * An optional modifier instruction for group placement, from reference. */ public position: string; /** * Top edge of the Thing's bounding box. */ public top: number; /** * Riight edge of the Thing's bounding box. */ public right: number; /** * Bottom edge of the Thing's bounding box. */ public bottom: number; /** * Left edge of the Thing's bounding box. */ public left: number; /** * @param {Thing} thing The Thing, freshly created by ObjectMaker.make. * @param {IPreThingSettings} reference The creation Object instruction * used to create the Thing. */ constructor(thing: IThing, reference: IPreThingSettings, ObjectMaker: ObjectMakr.IObjectMakr) { this.thing = thing; this.title = thing.title; this.reference = reference; this.spawned = false; this.left = reference.x || 0; this.top = reference.y || 0; this.right = this.left + ( reference.width || ObjectMaker.getFullPropertiesOf(this.title).width ); this.bottom = this.top + ( reference.height || ObjectMaker.getFullPropertiesOf(this.title).height ); if (reference.position) { this.position = reference.position; } } }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrMapRaw { name: string; locations: { [i: string]: IMapsCreatrLocationRaw; [i: number]: IMapsCreatrLocationRaw; }; areas: { [i: string]: IMapsCreatrAreaRaw; }; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrAreaRaw { creation: any[]; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrLocationRaw { entry?: string; area?: number | string; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrMap { /** * Whether the Map has had its areas and locations set in getMap. */ initialized: boolean; /** * A listing of areas in the Map, keyed by name. */ areas: { [i: string]: IMapsCreatrArea; [i: number]: IMapsCreatrArea; }; /** * A listing of locations in the Map, keyed by name. */ locations: any; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrArea { /** * The user-friendly label for this Area. */ name: string; /** * The Map this Area is a part of. */ map: IMapsCreatrMap; /** * A list of PreThing and macro commands to build this area from scratch. */ creation: any[]; /** * Groups that may be requested by creation commands to store generated * Things, so they may reference each other during gameplay. */ collections?: any; /** * The boundaries for the map; these all start at 0 and are stretched by * PreThings placed inside. */ boundaries: { "top": number; "right": number; "bottom": number; "left": number; }; /** * Optional listing of Things to provide to place at the end of the Area. */ afters?: (string | IPreThingSettings)[]; /** * Optional listing of Things to provide to stretch across the Area. */ stretches?: (string | IPreThingSettings)[]; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
export interface IMapsCreatrLocation { /** * The user-friendly label for this Location. */ name: string; /** * The Area this Location is a part of. */ area: IMapsCreatrArea; /** * The source name for the keyed entry Function used for this Location. */ entryRaw?: string; /** * The entrance Function used to enter this Location. */ entry?: Function; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IPreThingSettings { /** * The horizontal starting location of the Thing (by default, 0). */ x?: number; /** * The vertical starting location of the Thing (by default, 0). */ y?: number; /** * How wide the Thing is (by default, the Thing's prototype's width from * ObjectMaker.getFullPropertiesOf). */ width?: number; /** * How tall the Thing is (by default, the Thing's prototype's height from * ObjectMaker.getFullPropertiesOf). */ height?: number; /** * An optional immediate modifier instruction for where the Thing should be * in its GroupHoldr group (either "beginning", "end", or undefined). */ position?: string; /** * PreThings may pass any settings onto their created Things. */ [i: string]: any; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IThing { /** * The name of the Thing's constructor type, from the MapsCreatr's ObjectMakr. */ title: string; /** * An optional group for the Thing to be in, keyed by its id. */ collection?: any; /** * The key of the collection to place this Thing in, if collection isn't undefined. */ collectionKey?: string; /** * The name this is referred to in its collection, if collection isn't undefined. */ collectionName?: string; /** * Whether this should skip stretching the boundaries of an area */ noBoundaryStretch?: boolean; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrEntrance { (scope: any, location: IMapsCreatrLocation); }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrMacro { ( reference: any, prethings: { [i: string]: MapsCreatr.IPreThing[] }, area: IMapsCreatrArea | IMapsCreatrAreaRaw, map: IMapsCreatrMap | IMapsCreatrAreaRaw, scope: any ): MapsCreatr.IPreThing | MapsCreatr.IPreThing[]; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatrSettings { /** * An ObjectMakr used to create Maps and Things.Note that it must store * full properties of Things, for quick size lookups. */ ObjectMaker: ObjectMakr.IObjectMakr; /** * The names of groups Things may be in. */ groupTypes: string[]; /** * The key for Things to determine what group they belong to (by default, * "groupType"). */ keyGroupType?: string; /** * The key for Things to determine what, if any, Location they act as an * entrance for (by default, "entrance"). */ keyEntrance?: string; /** * A listing of macros that can be used to automate common operations. */ macros?: any; /** * A scope to give as a last parameter to macro Functions (by default, the * calling MapsCreatr). */ scope?: any; /** * Optional entrance Functions that may be used as the openings for * Locations. */ entrances?: any; /** * Whether Locations must have an entrance Function defined by "entry" (by * default, false). */ requireEntrance?: boolean; /** * Any maps that should be immediately stored via a storeMaps call, keyed * by name. */ maps?: any; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IPreThing { thing: IThing; title: any; reference: any; spawned: boolean; position: string; top: number; right: number; bottom: number; left: number; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
InterfaceDeclaration
/** * */ export interface IMapsCreatr { getObjectMaker(): ObjectMakr.IObjectMakr; getGroupTypes(): string[]; getKeyGroupType(): string; getKeyEntrance(): string; getMacros(): { [i: string]: IMapsCreatrMacro; }; getScope(): any; getRequireEntrance(): boolean; getMapsRaw(): any; getMaps(): any; getMapRaw(name: string): IMapsCreatrMapRaw; getMap(name: string): IMapsCreatrMap; storeMaps(maps: { [i: string]: IMapsCreatrMapRaw }): void; storeMap(name: string, mapRaw: IMapsCreatrMapRaw): IMapsCreatrMap; getPreThings(area: IMapsCreatrArea): any; analyzePreSwitch( reference: any, prethings: any, area: IMapsCreatrArea | IMapsCreatrAreaRaw, map: IMapsCreatrMap | IMapsCreatrMapRaw): any[] | any; analyzePreMacro( reference: any, prethings: any, area: IMapsCreatrArea | IMapsCreatrAreaRaw, map: IMapsCreatrMap | IMapsCreatrMapRaw): any[] | any; analyzePreThing( reference: any, prethings: any, area: IMapsCreatrArea | IMapsCreatrAreaRaw, map: IMapsCreatrMap | IMapsCreatrMapRaw): any[] | any; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/* Simple gets */ /** * @return {ObjectMakr} The internal ObjectMakr. */ getObjectMaker(): ObjectMakr.IObjectMakr { return this.ObjectMaker; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {String[]} The allowed group types. */ getGroupTypes(): string[] { return this.groupTypes; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {String} The key under which Things are to store their group. */ getKeyGroupType(): string { return this.keyGroupType; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {String} The key under which Things declare themselves an entrance. */ getKeyEntrance(): string { return this.keyEntrance; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {Object} The allowed macro Functions. */ getMacros(): { [i: string]: IMapsCreatrMacro; } { return this.macros; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {Mixed} The scope to give as a last parameter to macros. */ getScope(): any { return this.scope; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {Boolean} Whether Locations must have an entrance Function. */ getRequireEntrance(): boolean { return this.requireEntrance; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript
MethodDeclaration
/** * @return {Object} The Object storing raw maps, keyed by name. */ getMapsRaw(): any { return this.mapsRaw; }
Cloud-Swift/Mario
Source/References/MapsCreatr-0.2.1.ts
TypeScript