type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
/** * Adds a message to the queue. * * @param {Message} message The message to add. * @param {number} [deadline] The deadline. * @private */ add({ackId}: Message, deadline?: number): void { const {maxMessages, maxMilliseconds} = this._options; this._requests.push([ackId, deadline]); this.numPendingRequests += 1; if (this._requests.length >= maxMessages!) { this.flush(); } else if (!this._timer) { this._timer = setTimeout(() => this.flush(), maxMilliseconds!); } }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
MethodDeclaration
/** * Sends a batch of messages. * @private */ async flush(): Promise<void> { if (this._timer) { clearTimeout(this._timer); delete this._timer; } const batch = this._requests; const batchSize = batch.length; const deferred = this._onFlush; this._requests = []; this.numPendingRequests -= batchSize; delete this._onFlush; try { await this._sendBatch(batch); } catch (e) { this._subscriber.emit('error', e); } if (deferred) { deferred.resolve(); } }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
MethodDeclaration
/** * Returns a promise that resolves after the next flush occurs. * * @returns {Promise} * @private */ onFlush(): Promise<void> { if (!this._onFlush) { this._onFlush = defer(); } return this._onFlush.promise; }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
MethodDeclaration
/** * Set the batching options. * * @param {BatchOptions} options Batching options. * @private */ setOptions(options: BatchOptions): void { const defaults: BatchOptions = {maxMessages: 3000, maxMilliseconds: 100}; this._options = Object.assign(defaults, options); }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
MethodDeclaration
/** * Sends a batch of ack requests. * * @private * * @param {Array.<Array.<string|number>>} batch Array of ackIds and deadlines. * @return {Promise} */ protected async _sendBatch(batch: QueuedMessages): Promise<void> { const client = await this._subscriber.getClient(); const ackIds = batch.map(([ackId]) => ackId); const reqOpts = {subscription: this._subscriber.name, ackIds}; try { await client.acknowledge(reqOpts, this._options.callOptions!); } catch (e) { throw new BatchError(e, ackIds, 'acknowledge'); } }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
MethodDeclaration
/** * Sends a batch of modAck requests. Each deadline requires its own request, * so we have to group all the ackIds by deadline and send multiple requests. * * @private * * @param {Array.<Array.<string|number>>} batch Array of ackIds and deadlines. * @return {Promise} */ protected async _sendBatch(batch: QueuedMessages): Promise<void> { const client = await this._subscriber.getClient(); const subscription = this._subscriber.name; const modAckTable: {[index: string]: string[]} = batch.reduce( (table: {[index: string]: string[]}, [ackId, deadline]) => { if (!table[deadline!]) { table[deadline!] = []; } table[deadline!].push(ackId); return table; }, {} ); const modAckRequests = Object.keys(modAckTable).map(async deadline => { const ackIds = modAckTable[deadline]; const ackDeadlineSeconds = Number(deadline); const reqOpts = {subscription, ackIds, ackDeadlineSeconds}; try { await client.modifyAckDeadline(reqOpts, this._options.callOptions!); } catch (e) { throw new BatchError(e, ackIds, 'modifyAckDeadline'); } }); await Promise.all(modAckRequests); }
ajaaym/nodejs-pubsub
src/message-queues.ts
TypeScript
ArrowFunction
(config: CloudWatchClientConfig) => { emitWarningIfUnsupportedVersion(process.version); const clientSharedValues = getSharedRuntimeConfig(config); return { ...clientSharedValues, ...config, runtime: "node", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: config?.requestHandler ?? new NodeHttpHandler(), retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8, }; }
hixio-mh/aws-sdk-js-v3
clients/client-cloudwatch/src/runtimeConfig.ts
TypeScript
InterfaceDeclaration
export interface JaegerInfo { enabled: boolean; integration: boolean; url: string; namespaceSelector: boolean; whiteListIstioSystem: string[]; }
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type KeyValuePair = { key: string; type: string; value: any; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type Log = { timestamp: number; fields: Array<KeyValuePair>; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type SpanReference = { refType: 'CHILD_OF' | 'FOLLOWS_FROM'; // eslint-disable-next-line no-use-before-define span: Span | null | undefined; spanID: string; traceID: string; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type Process = { serviceName: string; tags: Array<KeyValuePair>; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type SpanData = { spanID: string; traceID: string; processID: string; operationName: string; startTime: number; duration: number; logs: Array<Log>; tags?: Array<KeyValuePair>; references?: Array<SpanReference>; warnings?: Array<string> | null; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type Span = SpanData & { depth: number; hasChildren: boolean; process: Process; relativeStartTime: number; tags: NonNullable<SpanData['tags']>; references: NonNullable<SpanData['references']>; warnings: NonNullable<SpanData['warnings']>; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type RichSpanData = Span & { type: 'envoy' | 'http' | 'tcp' | 'unknown'; component: string; namespace: string; app: string; linkToApp?: string; workload?: string; pod?: string; linkToWorkload?: string; info: OpenTracingBaseInfo; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type OpenTracingBaseInfo = { component?: string; hasError: boolean; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type OpenTracingHTTPInfo = OpenTracingBaseInfo & { statusCode?: number; url?: string; method?: string; direction?: 'inbound' | 'outbound'; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type OpenTracingTCPInfo = OpenTracingBaseInfo & { topic?: string; peerAddress?: string; peerHostname?: string; direction?: 'inbound' | 'outbound'; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type EnvoySpanInfo = OpenTracingHTTPInfo & { responseFlags?: string; peer?: Target; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type TraceData<S extends SpanData> = { processes: Record<string, Process>; traceID: string; spans: S[]; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type JaegerTrace = TraceData<RichSpanData> & { duration: number; endTime: number; startTime: number; traceName: string; services: { name: string; numberOfSpans: number }[]; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type JaegerError = { code?: number; msg: string; traceID?: string; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type JaegerResponse = { data: JaegerTrace[] | null; errors: JaegerError[]; jaegerServiceName: string; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
TypeAliasDeclaration
export type JaegerSingleResponse = { data: JaegerTrace | null; errors: JaegerError[]; };
Alan-Cha/kiali-ui
src/types/JaegerInfo.ts
TypeScript
ArrowFunction
(config: IDevSiteDesignSystem): string => { return config.lightGray; }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
ArrowFunction
(config: IDevSiteDesignSystem): string => { return toPx(config.navigationBarHeight / 4); }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
ArrowFunction
(config: IDevSiteDesignSystem): string => { return toPx(config.navigationBarHeight / 2); }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
ClassDeclaration
class ShellInfoBar extends React.Component<IShellInfoBarProps & IManagedClasses<IShellInfoBarManagedClasses>, {}> { public render(): JSX.Element { return ( <div className={this.props.managedClasses.shellInfoBar}> {this.props.children} </div> ); } }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
InterfaceDeclaration
/* tslint:disable-next-line */ export interface IShellInfoBarProps {}
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
InterfaceDeclaration
export interface IShellInfoBarManagedClasses { shellInfoBar: string; }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
MethodDeclaration
public render(): JSX.Element { return ( <div className={this.props.managedClasses.shellInfoBar}> {this.props.children} </div> ); }
TheLarkInn/fast-dna
packages/fast-development-site-react/src/components/shell/info-bar.tsx
TypeScript
FunctionDeclaration
function compareEntries(elementA: ListElement, elementB: ListElement, lookFor: string): number { const labelHighlightsA = elementA.labelHighlights || []; const labelHighlightsB = elementB.labelHighlights || []; if (labelHighlightsA.length && !labelHighlightsB.length) { return -1; } if (!labelHighlightsA.length && labelHighlightsB.length) { return 1; } return compareAnything(elementA.item.label, elementB.item.label, lookFor); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => { data.element.checked = data.checkbox.checked; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
checked => data.checkbox.checked = checked
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => element.label
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => { const event = new StandardKeyboardEvent(e); switch (event.keyCode) { case KeyCode.Space: this.toggleCheckbox(); break; case KeyCode.KEY_A: if (platform.isMacintosh ? e.metaKey : e.ctrlKey) { this.list.setFocus(range(this.list.length)); } break; case KeyCode.UpArrow: case KeyCode.PageUp: const focus1 = this.list.getFocus(); if (focus1.length === 1 && focus1[0] === 0) { this._onLeave.fire(); } break; case KeyCode.DownArrow: case KeyCode.PageDown: const focus2 = this.list.getFocus(); if (focus2.length === 1 && focus2[0] === this.list.length - 1) { this._onLeave.fire(); } break; } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => { if (e.x || e.y) { // Avoid 'click' triggered by 'space' on checkbox. this._onLeave.fire(); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => { if (e.elements.length) { this.list.setSelection([]); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => e.elements.map(e => e.item)
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => e.item
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => { if (!element.hidden) { element.checked = checked; } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
(item, index) => new ListElement({ index, item, checked: false })
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => element.onChecked(() => this.fireCheckedEvents())
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
() => this.fireCheckedEvents()
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
(map, element, index) => { map.set(element.item, index); return map; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
item => this.elementsToIndexes.has(item)
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
item => this.elementsToIndexes.get(item)
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
e => e.checked
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => { element.labelHighlights = undefined; element.descriptionHighlights = undefined; element.detailHighlights = undefined; element.hidden = false; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => { const labelHighlights = matchesFuzzyOcticonAware(query, parseOcticons(element.item.label)); const descriptionHighlights = this.matchOnDescription ? matchesFuzzyOcticonAware(query, parseOcticons(element.item.description || '')) : undefined; const detailHighlights = this.matchOnDetail ? matchesFuzzyOcticonAware(query, parseOcticons(element.item.detail || '')) : undefined; if (element.shouldAlwaysShow || labelHighlights || descriptionHighlights || detailHighlights) { element.labelHighlights = labelHighlights; element.descriptionHighlights = descriptionHighlights; element.detailHighlights = detailHighlights; element.hidden = false; } else { element.labelHighlights = undefined; element.descriptionHighlights = undefined; element.detailHighlights = undefined; element.hidden = true; } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
element => !element.hidden
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
(a, b) => { if (!query) { return a.index - b.index; // restore natural order } return compareEntries(a, b, normalizedSearchValue); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ArrowFunction
(theme, collector) => { // Override inactive focus background with active focus background for single-pick case. const listInactiveFocusBackground = theme.getColor(listFocusBackground); if (listInactiveFocusBackground) { collector.addRule(`.quick-input-list .monaco-list .monaco-list-row.focused { background-color: ${listInactiveFocusBackground}; }`); collector.addRule(`.quick-input-list .monaco-list .monaco-list-row.focused:hover { background-color: ${listInactiveFocusBackground}; }`); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ClassDeclaration
class ListElement implements IListElement { index: number; item: IQuickPickItem; shouldAlwaysShow = false; hidden = false; private _onChecked = new Emitter<boolean>(); onChecked = this._onChecked.event; _checked?: boolean; get checked() { return this._checked; } set checked(value: boolean) { if (value !== this._checked) { this._checked = value; this._onChecked.fire(value); } } labelHighlights?: IMatch[]; descriptionHighlights?: IMatch[]; detailHighlights?: IMatch[]; constructor(init: IListElement) { assign(this, init); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ClassDeclaration
class ListElementRenderer implements IRenderer<ListElement, IListElementTemplateData> { static readonly ID = 'listelement'; get templateId() { return ListElementRenderer.ID; } renderTemplate(container: HTMLElement): IListElementTemplateData { const data: IListElementTemplateData = Object.create(null); data.toDisposeElement = []; data.toDisposeTemplate = []; const entry = dom.append(container, $('.quick-input-list-entry')); // Checkbox const label = dom.append(entry, $('label.quick-input-list-label')); data.checkbox = <HTMLInputElement>dom.append(label, $('input.quick-input-list-checkbox')); data.checkbox.type = 'checkbox'; data.toDisposeTemplate.push(dom.addStandardDisposableListener(data.checkbox, dom.EventType.CHANGE, e => { data.element.checked = data.checkbox.checked; })); // Rows const rows = dom.append(label, $('.quick-input-list-rows')); const row1 = dom.append(rows, $('.quick-input-list-row')); const row2 = dom.append(rows, $('.quick-input-list-row')); // Label data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true }); // Detail const detailContainer = dom.append(row2, $('.quick-input-list-label-meta')); data.detail = new HighlightedLabel(detailContainer); return data; } renderElement(element: ListElement, index: number, data: IListElementTemplateData): void { data.toDisposeElement = dispose(data.toDisposeElement); data.element = element; data.checkbox.checked = element.checked; data.toDisposeElement.push(element.onChecked(checked => data.checkbox.checked = checked)); const { labelHighlights, descriptionHighlights, detailHighlights } = element; // Label const options: IIconLabelValueOptions = Object.create(null); options.matches = labelHighlights || []; options.descriptionTitle = element.item.description; options.descriptionMatches = descriptionHighlights || []; data.label.setValue(element.item.label, element.item.description, options); // Meta data.detail.set(element.item.detail, detailHighlights); } disposeElement(): void { // noop } disposeTemplate(data: IListElementTemplateData): void { data.toDisposeElement = dispose(data.toDisposeElement); data.toDisposeTemplate = dispose(data.toDisposeTemplate); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ClassDeclaration
class ListElementDelegate implements IVirtualDelegate<ListElement> { getHeight(element: ListElement): number { return element.item.detail ? 44 : 22; } getTemplateId(element: ListElement): string { return ListElementRenderer.ID; } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
InterfaceDeclaration
interface IListElement { index: number; item: IQuickPickItem; checked: boolean; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
InterfaceDeclaration
interface IListElementTemplateData { checkbox: HTMLInputElement; label: IconLabel; detail: HighlightedLabel; element: ListElement; toDisposeElement: IDisposable[]; toDisposeTemplate: IDisposable[]; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
renderTemplate(container: HTMLElement): IListElementTemplateData { const data: IListElementTemplateData = Object.create(null); data.toDisposeElement = []; data.toDisposeTemplate = []; const entry = dom.append(container, $('.quick-input-list-entry')); // Checkbox const label = dom.append(entry, $('label.quick-input-list-label')); data.checkbox = <HTMLInputElement>dom.append(label, $('input.quick-input-list-checkbox')); data.checkbox.type = 'checkbox'; data.toDisposeTemplate.push(dom.addStandardDisposableListener(data.checkbox, dom.EventType.CHANGE, e => { data.element.checked = data.checkbox.checked; })); // Rows const rows = dom.append(label, $('.quick-input-list-rows')); const row1 = dom.append(rows, $('.quick-input-list-row')); const row2 = dom.append(rows, $('.quick-input-list-row')); // Label data.label = new IconLabel(row1, { supportHighlights: true, supportDescriptionHighlights: true }); // Detail const detailContainer = dom.append(row2, $('.quick-input-list-label-meta')); data.detail = new HighlightedLabel(detailContainer); return data; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
renderElement(element: ListElement, index: number, data: IListElementTemplateData): void { data.toDisposeElement = dispose(data.toDisposeElement); data.element = element; data.checkbox.checked = element.checked; data.toDisposeElement.push(element.onChecked(checked => data.checkbox.checked = checked)); const { labelHighlights, descriptionHighlights, detailHighlights } = element; // Label const options: IIconLabelValueOptions = Object.create(null); options.matches = labelHighlights || []; options.descriptionTitle = element.item.description; options.descriptionMatches = descriptionHighlights || []; data.label.setValue(element.item.label, element.item.description, options); // Meta data.detail.set(element.item.detail, detailHighlights); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
disposeElement(): void { // noop }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
disposeTemplate(data: IListElementTemplateData): void { data.toDisposeElement = dispose(data.toDisposeElement); data.toDisposeTemplate = dispose(data.toDisposeTemplate); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getHeight(element: ListElement): number { return element.item.detail ? 44 : 22; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getTemplateId(element: ListElement): string { return ListElementRenderer.ID; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getAllVisibleChecked() { return this.allVisibleChecked(this.elements, false); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
private allVisibleChecked(elements: ListElement[], whenNoneVisible = true) { for (let i = 0, n = elements.length; i < n; i++) { const element = elements[i]; if (!element.hidden) { if (!element.checked) { return false; } else { whenNoneVisible = true; } } } return whenNoneVisible; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getCheckedCount() { let count = 0; const elements = this.elements; for (let i = 0, n = elements.length; i < n; i++) { if (elements[i].checked) { count++; } } return count; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getVisibleCount() { let count = 0; const elements = this.elements; for (let i = 0, n = elements.length; i < n; i++) { if (!elements[i].hidden) { count++; } } return count; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
setAllVisibleChecked(checked: boolean) { try { this._fireCheckedEvents = false; this.elements.forEach(element => { if (!element.hidden) { element.checked = checked; } }); } finally { this._fireCheckedEvents = true; this.fireCheckedEvents(); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
setElements(elements: IQuickPickItem[]): void { this.elementDisposables = dispose(this.elementDisposables); this.elements = elements.map((item, index) => new ListElement({ index, item, checked: false })); this.elementDisposables.push(...this.elements.map(element => element.onChecked(() => this.fireCheckedEvents()))); this.elementsToIndexes = this.elements.reduce((map, element, index) => { map.set(element.item, index); return map; }, new Map<IQuickPickItem, number>()); this.list.splice(0, this.list.length, this.elements); this.list.setFocus([]); this._onChangedVisibleCount.fire(this.elements.length); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getFocusedElements() { return this.list.getFocusedElements() .map(e => e.item); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
setFocusedElements(items: IQuickPickItem[]) { this.list.setFocus(items .filter(item => this.elementsToIndexes.has(item)) .map(item => this.elementsToIndexes.get(item))); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getSelectedElements() { return this.list.getSelectedElements() .map(e => e.item); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
setSelectedElements(items: IQuickPickItem[]) { this.list.setSelection(items .filter(item => this.elementsToIndexes.has(item)) .map(item => this.elementsToIndexes.get(item))); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
getCheckedElements() { return this.elements.filter(e => e.checked) .map(e => e.item); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
setCheckedElements(items: IQuickPickItem[]) { try { this._fireCheckedEvents = false; const checked = new Set(); for (const item of items) { checked.add(item); } for (const element of this.elements) { element.checked = checked.has(element.item); } } finally { this._fireCheckedEvents = true; this.fireCheckedEvents(); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
focus(what: 'First' | 'Last' | 'Next' | 'Previous' | 'NextPage' | 'PreviousPage'): void { if (!this.list.length) { return; } if ((what === 'Next' || what === 'NextPage') && this.list.getFocus()[0] === this.list.length - 1) { what = 'First'; } if ((what === 'Previous' || what === 'PreviousPage') && this.list.getFocus()[0] === 0) { what = 'Last'; } this.list['focus' + what](); this.list.reveal(this.list.getFocus()[0]); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
clearFocus() { this.list.setFocus([]); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
domFocus() { this.list.domFocus(); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
layout(): void { this.list.layout(); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
filter(query: string) { query = query.trim(); // Reset filtering if (!query) { this.elements.forEach(element => { element.labelHighlights = undefined; element.descriptionHighlights = undefined; element.detailHighlights = undefined; element.hidden = false; }); } // Filter by value (since we support octicons, use octicon aware fuzzy matching) else { this.elements.forEach(element => { const labelHighlights = matchesFuzzyOcticonAware(query, parseOcticons(element.item.label)); const descriptionHighlights = this.matchOnDescription ? matchesFuzzyOcticonAware(query, parseOcticons(element.item.description || '')) : undefined; const detailHighlights = this.matchOnDetail ? matchesFuzzyOcticonAware(query, parseOcticons(element.item.detail || '')) : undefined; if (element.shouldAlwaysShow || labelHighlights || descriptionHighlights || detailHighlights) { element.labelHighlights = labelHighlights; element.descriptionHighlights = descriptionHighlights; element.detailHighlights = detailHighlights; element.hidden = false; } else { element.labelHighlights = undefined; element.descriptionHighlights = undefined; element.detailHighlights = undefined; element.hidden = true; } }); } const shownElements = this.elements.filter(element => !element.hidden); // Sort by value const normalizedSearchValue = query.toLowerCase(); shownElements.sort((a, b) => { if (!query) { return a.index - b.index; // restore natural order } return compareEntries(a, b, normalizedSearchValue); }); this.elementsToIndexes = shownElements.reduce((map, element, index) => { map.set(element.item, index); return map; }, new Map<IQuickPickItem, number>()); this.list.splice(0, this.list.length, shownElements); this.list.setFocus([]); this.list.layout(); this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); this._onChangedVisibleCount.fire(shownElements.length); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
toggleCheckbox() { try { this._fireCheckedEvents = false; const elements = this.list.getFocusedElements(); const allChecked = this.allVisibleChecked(elements); for (const element of elements) { element.checked = !allChecked; } } finally { this._fireCheckedEvents = true; this.fireCheckedEvents(); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
display(display: boolean) { this.container.style.display = display ? '' : 'none'; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
isDisplayed() { return this.container.style.display !== 'none'; }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
dispose() { this.elementDisposables = dispose(this.elementDisposables); this.disposables = dispose(this.disposables); }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
MethodDeclaration
private fireCheckedEvents() { if (this._fireCheckedEvents) { this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); this._onChangedCheckedCount.fire(this.getCheckedCount()); this._onChangedCheckedElements.fire(this.getCheckedElements()); } }
MarcelRaschke/azuredatastudio
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
TypeScript
ClassDeclaration
// @dynamic @NgModule({ imports: [ CommonModule, RouterModule ], exports: [ AppBreadcrumbComponent, CuiBreadcrumbComponent ], declarations: [ AppBreadcrumbComponent, CuiBreadcrumbComponent ] }) export class AppBreadcrumbModule { static forRoot(config?: any): ModuleWithProviders<AppBreadcrumbModule> { return { ngModule: AppBreadcrumbModule, providers: [ AppBreadcrumbService ] }; } }
damingerdai/daming-core-ui
src/app/shared/components/breadcrumb/app-breadcrumb.module.ts
TypeScript
MethodDeclaration
static forRoot(config?: any): ModuleWithProviders<AppBreadcrumbModule> { return { ngModule: AppBreadcrumbModule, providers: [ AppBreadcrumbService ] }; }
damingerdai/daming-core-ui
src/app/shared/components/breadcrumb/app-breadcrumb.module.ts
TypeScript
ArrowFunction
(event : any) => { console.log(event, 'haller'); }
Lorenzras/kintone-customize
kintone-portal/src/handlers/kintone/onIndexShowHandler.ts
TypeScript
ClassDeclaration
@Resolver('IssueMutations') export class IssueCreateResolver { constructor(private readonly issueService: IssueService) {} @ResolveField('issueCreate') async issueCreate(@Args('input') params: IssueCreateDto) { const { title, description } = params; try { const issue = this.issueService.create({title, description}); return { ok: true, issue, }; } catch (e) { throw new Error(`Create Issue Error: ${e}`); } } }
dmitrykryvenko/issue-api
src/modules/issue/resolvers/mutations/issue-create/issue-create.resolver.ts
TypeScript
MethodDeclaration
@ResolveField('issueCreate') async issueCreate(@Args('input') params: IssueCreateDto) { const { title, description } = params; try { const issue = this.issueService.create({title, description}); return { ok: true, issue, }; } catch (e) { throw new Error(`Create Issue Error: ${e}`); } }
dmitrykryvenko/issue-api
src/modules/issue/resolvers/mutations/issue-create/issue-create.resolver.ts
TypeScript
TypeAliasDeclaration
export type SetupRouterFunction = ( config: Config, services: Services ) => express.Router;
NiHS-Bon/idem
server/src/typings/setup-router.ts
TypeScript
ClassDeclaration
@Entity('client') export class Client extends AbstractEntity { @IsNotEmpty() @ApiModelProperty() @Column({name: 'name'}) name: string; @Column({name: 'phone'}) @IsNotEmpty() @ApiModelProperty() phone: string; @Column({ name: 'phone_type', type: "enum", enum: PhoneType, default: PhoneType.NO_ESPECIFICADO}) @IsNotEmpty() @ApiModelProperty() phoneType: PhoneType; @ApiModelProperty() @Column({name: 'email'}) email: string; constructor(o: Partial<Client>) { super(); Object.assign(this, o); } }
llopez93/logistic-app-backend
src/model/client.entity.ts
TypeScript
ClassDeclaration
export class GPUComputationRenderer { constructor(sizeX: number, sizeY: number, renderer: WebGLRenderer); setDataType(type: TextureDataType): void; addVariable( variableName: string, computeFragmentShader: string, initialValueTexture: Texture, ): Variable; setVariableDependencies( variable: Variable, dependencies: Variable[] | null, ): void; init(): string | null; compute(): void; getCurrentRenderTarget(variable: Variable): RenderTarget; getAlternateRenderTarget(variable: Variable): RenderTarget; addResolutionDefine(materialShader: ShaderMaterial): void; createRenderTarget( sizeXTexture: number, sizeYTexture: number, wrapS: Wrapping, wrapT: number, minFilter: TextureFilter, magFilter: TextureFilter, ): RenderTarget; createTexture(): DataTexture; renderTexture(input: Texture, output: Texture): void; doRenderTarget(material: Material, output: RenderTarget): void; }
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
InterfaceDeclaration
export interface Variable { name: string; initialValueTexture: Texture; material: ShaderMaterial; dependencies: Variable[]; renderTargets: RenderTarget[]; wrapS: number; wrapT: number; minFilter: number; magFilter: number; }
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
MethodDeclaration
setDataType(type: TextureDataType): void;
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
MethodDeclaration
addVariable( variableName: string, computeFragmentShader: string, initialValueTexture: Texture, ): Variable;
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
MethodDeclaration
setVariableDependencies( variable: Variable, dependencies: Variable[] | null, ): void;
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
MethodDeclaration
init(): string | null;
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript
MethodDeclaration
compute(): void;
DefinitelyMaybe/threejs_4_deno
examples/jsm/misc/GPUComputationRenderer.d.ts
TypeScript