type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
export function toTooltipHtml(input: string | TooltipRendererResult, defaults?: TooltipRendererResult): string { if (typeof input === 'string') { return input; } defaults = defaults || {}; const { content = defaults.content || '', title = defaults.title || undefined, c...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
FunctionDeclaration
function getDistance(p1: Point, p2: Point): number { return Math.sqrt((p1.x - p2.x)**2 + (p1.y - p2.y)**2); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
entries => { for (const entry of entries) { if (entry.target === target && entry.intersectionRatio === 0) { this.toggle(false); } } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
() => { this.toggle(true); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => series.data = data
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
size => { if (size.width !== chart.width || size.height !== chart.height) { chart.scene.resize(size.width, size.height); chart.fireEvent({ type: 'layoutChange' }); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
() => this.tooltip.toggle()
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
axis => this.detachAxis(axis)
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
a => !a.linkedTo
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
a => a.linkedTo
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
axis => this.attachAxis(axis)
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => this.addSeries(series)
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => { this.freeSeries(series); this.seriesRoot.removeChild(series.group); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
axis => { const axisName = axis.direction + 'Axis'; const boundSeries: Series[] = []; this.series.forEach(series => { if ((series as any)[axisName] === axis) { boundSeries.push(series); } }); axis.boundSer...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => { if ((series as any)[axisName] === axis) { boundSeries.push(series); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
axis => { const direction = axis.direction; const directionAxes = directionToAxesMap[direction] || (directionToAxesMap[direction] = []); directionAxes.push(axis); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => { series.directions.forEach(direction => { const axisName = direction + 'Axis'; if (!(series as any)[axisName] || force) { const directionAxes = directionToAxesMap[direction]; if (directionAxes) { cons...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
direction => { const axisName = direction + 'Axis'; if (!(series as any)[axisName] || force) { const directionAxes = directionToAxesMap[direction]; if (directionAxes) { const axis = this.findMatchingAxis(directionAxes, seri...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
s => s.nodeDataPending = true
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
() => { this.layoutCallbackId = 0; this.background.width = this.width; this.background.height = this.height; this.performLayout(); if (!this.layoutPending) { this.fireEvent({ type: 'layoutDone' }); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
() => { this.dataPending = false; this.processData(); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
s => s.processData()
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
s => { const data = s.visible ? s.createNodeData() : []; this.nodeData.set(s, data); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
(d, s) => { if (s.visible && s.label.enabled) { series.push(s); data.push(s.getLabelData()); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
(l, i) => [series[i], l]
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
s => s.showInLegend
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => series.listSeriesItems(legendData)
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
datum => datum.label.text = formatter({ id: datum.id, itemId: datum.itemId, value: datum.label.text })
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
() => { this.update(); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => { if (series.updatePending) { series.update(); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
datum => { if (!datum.point) { return; } const distance = getDistance(hitPoint, datum.point); if (distance < minDistance) { minDistance = distance; closestDatum = datum; } ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
series => series.id === id
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ArrowFunction
s => s.updatePending = true
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
ClassDeclaration
export class ChartTooltip extends Observable { chart: Chart; element: HTMLDivElement; private observer?: IntersectionObserver; @reactive() enabled: boolean = true; @reactive() class: string = Chart.defaultTooltipClass; @reactive() delay: number = 0; /** * If `true`, the tooltip w...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
InterfaceDeclaration
export interface ChartClickEvent extends SourceEvent<Chart> { event: MouseEvent; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
InterfaceDeclaration
export interface TooltipMeta { pageX: number; pageY: number; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
InterfaceDeclaration
export interface TooltipRendererResult { content?: string; title?: string; color?: string; backgroundColor?: string; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
TypeAliasDeclaration
type Point = { x: number, y: number};
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
destroy() { const { parentNode } = this.element; if (parentNode) { parentNode.removeChild(this.element); } if (this.observer) { this.observer.unobserve(this.chart.scene.canvas.element); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
isVisible(): boolean { const { element } = this; if (element.classList) { // if not IE11 return !element.classList.contains(Chart.defaultTooltipClass + '-hidden'); } // IE11 part. const classes = element.getAttribute('class'); if (classes) { retu...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
updateClass(visible?: boolean, constrained?: boolean) { const classList = [Chart.defaultTooltipClass, this.class]; if (visible !== true) { classList.push(`${Chart.defaultTooltipClass}-hidden`); } if (constrained !== true) { classList.push(`${Chart.defaultTooltip...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
/** * Shows tooltip at the given event's coordinates. * If the `html` parameter is missing, moves the existing tooltip to the new position. */ show(meta: TooltipMeta, html?: string, instantly = false) { const el = this.element; if (html !== undefined) { el.innerHTML = html; ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
toggle(visible?: boolean) { if (!visible) { window.clearTimeout(this.showTimeout); if (this.chart.lastPick && !this.delay) { this.chart.dehighlightDatum(); this.chart.lastPick = undefined; } } this.updateClass(visible, this.con...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
download(fileName?: string) { this.scene.download(fileName); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
destroy() { this.tooltip.destroy(); SizeMonitor.unobserve(this.element); this.container = undefined; this.cleanupDomListeners(this.scene.canvas.element); this.scene.container = undefined; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private onLegendPositionChange() { this.legendAutoPadding.clear(); this.layoutPending = true; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private onCaptionChange(event: PropertyChangeEvent<this, Caption | undefined>) { const { value, oldValue } = event; if (oldValue) { oldValue.removeEventListener('change', this.scheduleLayout, this); this.scene.root!.removeChild(oldValue.node); } if (value) { ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected attachAxis(axis: ChartAxis) { this.scene.root!.insertBefore(axis.group, this.seriesRoot); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected detachAxis(axis: ChartAxis) { this.scene.root!.removeChild(axis.group); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected scheduleLayout() { this.layoutPending = true; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private scheduleData() { // To prevent the chart from thinking the cursor is over the same node // after a change to data (the nodes are reused on data changes). this.dehighlightDatum(); this.dataPending = true; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
addSeries(series: Series, before?: Series): boolean { const { series: allSeries, seriesRoot } = this; const canAdd = allSeries.indexOf(series) < 0; if (canAdd) { const beforeIndex = before ? allSeries.indexOf(before) : -1; if (beforeIndex >= 0) { allSer...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected initSeries(series: Series) { series.chart = this; if (!series.data) { series.data = this.data; } series.addEventListener('layoutChange', this.scheduleLayout, this); series.addEventListener('dataChange', this.scheduleData, this); series.addEventListe...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected freeSeries(series: Series) { series.chart = undefined; series.removeEventListener('layoutChange', this.scheduleLayout, this); series.removeEventListener('dataChange', this.scheduleData, this); series.removeEventListener('legendChange', this.updateLegend, this); series....
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
addSeriesAfter(series: Series, after?: Series): boolean { const { series: allSeries, seriesRoot } = this; const canAdd = allSeries.indexOf(series) < 0; if (canAdd) { const afterIndex = after ? this.series.indexOf(after) : -1; if (afterIndex >= 0) { if (...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
removeSeries(series: Series): boolean { const index = this.series.indexOf(series); if (index >= 0) { this.series.splice(index, 1); this.freeSeries(series); this.seriesRoot.removeChild(series.group); this.seriesChanged = true; return true; ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
removeAllSeries(): void { this.series.forEach(series => { this.freeSeries(series); this.seriesRoot.removeChild(series.group); }); this._series = []; // using `_series` instead of `series` to prevent infinite recursion this.seriesChanged = true; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected assignSeriesToAxes() { this.axes.forEach(axis => { const axisName = axis.direction + 'Axis'; const boundSeries: Series[] = []; this.series.forEach(series => { if ((series as any)[axisName] === axis) { boundSeries.push(series); ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected assignAxesToSeries(force: boolean = false) { // This method has to run before `assignSeriesToAxes`. const directionToAxesMap: { [key in ChartAxisDirection]?: ChartAxis[] } = {}; this.axes.forEach(axis => { const direction = axis.direction; const directionAxes ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private findMatchingAxis(directionAxes: ChartAxis[], directionKeys?: string[]): ChartAxis | undefined { for (let i = 0; i < directionAxes.length; i++) { const axis = directionAxes[i]; const axisKeys = axis.keys; if (!axisKeys.length) { return axis; ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
processData(): void { this.layoutPending = false; if (this.axesChanged) { this.assignAxesToSeries(true); this.assignSeriesToAxes(); } if (this.seriesChanged) { this.assignSeriesToAxes(); } this.series.forEach(s => s.processData()); ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
createNodeData(): void { this.nodeData.clear(); this.series.forEach(s => { const data = s.visible ? s.createNodeData() : []; this.nodeData.set(s, data); }); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
placeLabels(): Map<Series, PlacedLabel[]> { const series: Series[] = []; const data: (readonly PointLabelDatum[])[] = []; this.nodeData.forEach((d, s) => { if (s.visible && s.label.enabled) { series.push(s); data.push(s.getLabelData()); } ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private updateLegend() { const legendData: LegendDatum[] = []; this.series.filter(s => s.showInLegend).forEach(series => series.listSeriesItems(legendData)); const { formatter } = this.legend.item.label; if (formatter) { legendData.forEach(datum => datum.label.text = forma...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
abstract performLayout(): void;
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
update() { this.updatePending = false; this.series.forEach(series => { if (series.updatePending) { series.update(); } }); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected positionCaptions() { const { title, subtitle } = this; let titleVisible = false; let subtitleVisible = false; const spacing = 10; let paddingTop = spacing; if (title && title.enabled) { title.node.x = this.width / 2; title.node.y = pa...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected positionLegend() { if (!this.legend.enabled || !this.legend.data.length) { return; } const { legend, captionAutoPadding, legendAutoPadding } = this; const width = this.width; const height = this.height - captionAutoPadding; const legendGroup = lege...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected setupDomListeners(chartElement: HTMLCanvasElement) { chartElement.addEventListener('mousedown', this._onMouseDown); chartElement.addEventListener('mousemove', this._onMouseMove); chartElement.addEventListener('mouseup', this._onMouseUp); chartElement.addEventListener('mouseout...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected cleanupDomListeners(chartElement: HTMLCanvasElement) { chartElement.removeEventListener('mousedown', this._onMouseDown); chartElement.removeEventListener('mousemove', this._onMouseMove); chartElement.removeEventListener('mouseup', this._onMouseUp); chartElement.removeEventList...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
getSeriesRect(): Readonly<BBox | undefined> { return this.seriesRect; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
// x/y are local canvas coordinates in CSS pixels, not actual pixels private pickSeriesNode(x: number, y: number): { series: Series, node: Node } | undefined { if (!(this.seriesRect && this.seriesRect.containsPoint(x, y))) { return undefined; } const allSeries = ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
// Provided x/y are in canvas coordinates. private pickClosestSeriesNodeDatum(x: number, y: number): SeriesNodeDatum | undefined { if (!this.seriesRect || !this.seriesRect.containsPoint(x, y)) { return undefined; } const allSeries = this.series; type Point = { x: number, y:...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected onMouseMove(event: MouseEvent): void { this.handleLegendMouseMove(event); if (this.tooltip.enabled) { if (this.tooltip.delay > 0) { this.tooltip.toggle(false); } this.handleTooltip(event); } }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected handleTooltip(event: MouseEvent) { const { lastPick, tooltip: { tracking: tooltipTracking } } = this; const { offsetX, offsetY } = event; const pick = this.pickSeriesNode(offsetX, offsetY); let nodeDatum: SeriesNodeDatum | undefined; if (pick && pick.node instanceof S...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected onMouseDown(event: MouseEvent) {}
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected onMouseUp(event: MouseEvent) {}
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected onMouseOut(event: MouseEvent) { this.tooltip.toggle(false); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
protected onClick(event: MouseEvent) { if (this.checkSeriesNodeClick()) { return; } if (this.checkLegendClick(event)) { return; } this.fireEvent<ChartClickEvent>({ type: 'click', event }); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private checkSeriesNodeClick(): boolean { const { lastPick } = this; if (lastPick && lastPick.event && lastPick.node) { const { event, datum } = lastPick; datum.series.fireNodeClickEvent(event, datum); return true; } return false; }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private onSeriesNodeClick(event: SourceEvent<Series>) { this.fireEvent({ ...event, type: 'seriesNodeClick' }); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private checkLegendClick(event: MouseEvent): boolean { const datum = this.legend.getDatumForPoint(event.offsetX, event.offsetY); if (datum) { const { id, itemId, enabled } = datum; const series = find(this.series, series => series.id === id); if (series) { ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private handleLegendMouseMove(event: MouseEvent) { if (!this.legend.enabled) { return; } const { offsetX, offsetY } = event; const datum = this.legend.getDatumForPoint(offsetX, offsetY); const pointerInsideLegend = this.legendBBox.containsPoint(offsetX, offsetY); ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
private onSeriesDatumPick(meta: TooltipMeta, datum: SeriesNodeDatum, node?: Shape, event?: MouseEvent) { const { lastPick } = this; if (lastPick) { if (lastPick.datum === datum) { return; } this.dehighlightDatum(); } this.lastPick = { datum, ...
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
highlightDatum(datum: SeriesNodeDatum): void { this.scene.canvas.element.style.cursor = datum.series.cursor; this.highlightedDatum = datum; this.series.forEach(s => s.updatePending = true); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
MethodDeclaration
dehighlightDatum(): void { this.scene.canvas.element.style.cursor = 'default'; this.highlightedDatum = undefined; this.series.forEach(s => s.updatePending = true); }
HugoUno/ag-grid
charts-packages/ag-charts-community/src/chart/chart.ts
TypeScript
FunctionDeclaration
function testLogLevels(logger: ILogger, minLevel: LogLevel) { const capturingConsole = new CapturingConsole(); (logger as ConsoleLogger).out = capturingConsole; for (let level = LogLevel.Trace; level < LogLevel.None; level++) { const message = `Message at LogLevel.$...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
FunctionDeclaration
function createConnectionBuilder(logger?: ILogger): HubConnectionBuilder { // We don't want to spam test output with logs. This can be changed as needed return new HubConnectionBuilder() .configureLogging(logger || NullLogger.instance); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
FunctionDeclaration
function createTestClient(pollSent: PromiseSource<HttpRequest>, pollCompleted: Promise<HttpResponse>, negotiateResponse?: any): TestHttpClient { let firstRequest = true; return new TestHttpClient() .on("POST", "http://example.com/negotiate?negotiateVersion=1", () => negotiateResponse || longPollingNego...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
FunctionDeclaration
function eachMissingValue(callback: (val: undefined | null, name: string) => void) { callback(null, "null"); callback(undefined, "undefined"); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
() => { const builder = new HubConnectionBuilder(); expect(() => builder.withUrl(val!)).toThrow(/The 'url' argument (is required|should not be empty)./); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
() => builder.withUrl(val!)
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
(val, name) => { it(`withHubProtocol throws if protocol is ${name}`, () => { const builder = new HubConnectionBuilder(); expect(() => builder.withHubProtocol(val!)).toThrow("The 'protocol' argument is required."); }); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
() => { const builder = new HubConnectionBuilder(); expect(() => builder.withHubProtocol(val!)).toThrow("The 'protocol' argument is required."); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
() => builder.withHubProtocol(val!)
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
async () => { await VerifyLogger.run(async (logger) => { const pollSent = new PromiseSource<HttpRequest>(); const pollCompleted = new PromiseSource<HttpResponse>(); const testClient = createTestClient(pollSent, pollCompleted.promise) .on("POST", "http://examp...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
async (logger) => { const pollSent = new PromiseSource<HttpRequest>(); const pollCompleted = new PromiseSource<HttpResponse>(); const testClient = createTestClient(pollSent, pollCompleted.promise) .on("POST", "http://example.com?id=123abc", (req) => { ...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
(req) => { // Respond from the poll with the handshake response pollCompleted.resolve(new HttpResponse(204, "No Content", "{}")); return new HttpResponse(202); }
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
async () => { const protocol = new TestProtocol(); const builder = createConnectionBuilder() .withUrl("http://example.com", HttpTransportType.WebSockets) .withHubProtocol(protocol); expect(builder.httpConnectionOptions!.transport).toBe(HttpTransportType.WebSockets); ...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript
ArrowFunction
async () => { await VerifyLogger.run(async (logger) => { const protocol = new TestProtocol(); const pollSent = new PromiseSource<HttpRequest>(); const pollCompleted = new PromiseSource<HttpResponse>(); let negotiateRequest!: HttpRequest; const testCl...
1175169074/aspnetcore
src/SignalR/clients/ts/signalr/tests/HubConnectionBuilder.test.ts
TypeScript