type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(r) => { r.should.haveOwnProperty('id') r.should.haveOwnProperty('jsonrpc') r.should.haveOwnProperty('error') r['error'].should.haveOwnProperty('message') r['error'].should.haveOwnProperty('code') r['error']['message'].should.equal( JSONRPC_ERRORS.INVALID_REQUE...
Genysys/optimism-monorepo
packages/rollup-full-node/test/app/fullnode-rpc-server.spec.ts
TypeScript
ClassDeclaration
class DummyFullnodeHandler implements FullnodeHandler { public async handleRequest( method: string, params: string[] ): Promise<string> { if (method === unsupportedMethod) { throw new UnsupportedMethodError() } if (method === revertMethod) { throw new RevertError() } return ...
Genysys/optimism-monorepo
packages/rollup-full-node/test/app/fullnode-rpc-server.spec.ts
TypeScript
MethodDeclaration
public async handleRequest( method: string, params: string[] ): Promise<string> { if (method === unsupportedMethod) { throw new UnsupportedMethodError() } if (method === revertMethod) { throw new RevertError() } return dummyResponse }
Genysys/optimism-monorepo
packages/rollup-full-node/test/app/fullnode-rpc-server.spec.ts
TypeScript
FunctionDeclaration
/** @docs-private */ export function OWL_LUXON_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): OwlLuxonDateTimeAdapterOptions { return { useUtc: false, parseStrict: false, }; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
FunctionDeclaration
/** Creates an array and fills it with values. */ function range<T>(length: number, valueFunction: (index: number) => T): T[] { const valuesArray = Array(length); for (let i = 0; i < length; i++) { valuesArray[i] = valueFunction(i); } return valuesArray; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
ClassDeclaration
@Injectable() export class LuxonDateTimeAdapter extends DateTimeAdapter<DateTime> { getDate(date: DateTime): number { throw new Error('Method not implemented.'); } getTime(date: DateTime): number { throw new Error('Method not implemented.'); } clone(date: DateTime): DateTime { ...
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
InterfaceDeclaration
/** Configurable options for {@see LuxonDateAdapter}. */ export interface OwlLuxonDateTimeAdapterOptions { /** * Turns the use of utc dates on or off. * Changing this will change how the DateTimePicker output value. * {@default false} */ useUtc: boolean; /** * Turns the use of stri...
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
getDate(date: DateTime): number { throw new Error('Method not implemented.'); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
getTime(date: DateTime): number { throw new Error('Method not implemented.'); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
clone(date: DateTime): DateTime { return date; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public setLocale(locale: string) { super.setLocale(locale); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getYear(date: DateTime): number { return date.year; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getMonth(date: DateTime): number { return date.month; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getDay(date: DateTime): number { return date.day; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getHours(date: DateTime): number { return date.hour; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getMinutes(date: DateTime): number { return date.minute; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getSeconds(date: DateTime): number { return date.second; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getNumDaysInMonth(date: DateTime): number { return date.daysInMonth; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public differenceInCalendarDays( dateLeft: DateTime, dateRight: DateTime ): number { return dateLeft.diff(dateRight, 'days').days; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getYearName(date: DateTime): string { return date.toFormat('YYYY'); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getMonthNames(style: 'long' | 'short' | 'narrow'): string[] { return style === 'long' ? Info.months('long') : Info.months('short'); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] { if (style === 'long') { return Info.weekdays('long'); } return Info.weekdays('short'); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public getDateNames(): string[] { return []; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public toIso8601(date: DateTime): string { return date.toISO(); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public isEqual(dateLeft: DateTime, dateRight: DateTime): boolean { if (dateLeft && dateRight) { return dateLeft === dateRight; } return dateLeft === dateRight; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public isSameDay(dateLeft: DateTime, dateRight: DateTime): boolean { if (dateLeft && dateRight) { return dateLeft.hasSame(dateRight, 'day'); } return dateLeft === dateRight; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public isValid(date: DateTime): boolean { return date.isValid; }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public invalid(): DateTime { return DateTime.invalid(''); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public isDateInstance(obj: any): boolean { return DateTime.isDateTime(obj); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public addCalendarYears(date: DateTime, amount: number): DateTime { return date.plus({ years: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public addCalendarMonths(date: DateTime, amount: number): DateTime { return date.plus({ months: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public addCalendarDays(date: DateTime, amount: number): DateTime { return date.plus({ days: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public setHours(date: DateTime, amount: number): DateTime { return date.set({ hour: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public setMinutes(date: DateTime, amount: number): DateTime { return date.set({ minute: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public setSeconds(date: DateTime, amount: number): DateTime { return date.set({ second: amount }); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public createDate(year: number, month: number, date: number): DateTime;
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public createDate( year: number, month: number, date: number, hours: number = 0, minutes: number = 0, seconds: number = 0 ): DateTime { if (month < 1 || month > 12) { throw Error( `Invalid month index "${month}". Month index has to...
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public now(): DateTime { return DateTime.now(); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public format(date: DateTime, displayFormat: any): string { if (!this.isValid(date)) { throw Error('LuxonDateTimeAdapter: Cannot format invalid date.'); } return date.toFormat(displayFormat); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
public parse(value: any, parseFormat: any): DateTime | null { if (value && value instanceof Date) { return DateTime.fromJSDate(value); } if (value && typeof value === 'string') { return DateTime.fromFormat(value, parseFormat); } return value ?...
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
/** * Returns the given value if given a valid DateTime or null. Deserializes valid ISO 8601 strings * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid DateTimes and empty * string into null. Returns an invalid date for all other values. */ deserialize(value: any): DateTime |...
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
MethodDeclaration
/** Creates a DateTime instance while respecting the current UTC settings. */ private createDateTime(...args: any[]): DateTime { return this.options && this.options.useUtc ? DateTime.utc(...args) : DateTime.local(...args); }
David-Lees/date-time-picker
projects/picker/src/lib/date-time/adapter/luxon-adapter/luxon-date-time-adapter.class.ts
TypeScript
ArrowFunction
(width: number, height: number) => { var canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; canvas.oncontextmenu = () => false; canvas.onselectstart = () => false; return canvas; }
playpuppy/matter-ts
src/render.ts
TypeScript
ArrowFunction
(canvas: HTMLCanvasElement) => { const context = canvas.getContext('2d') as any; const devicePixelRatio = window.devicePixelRatio || 1; const backingStorePixelRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRat...
playpuppy/matter-ts
src/render.ts
TypeScript
ArrowFunction
(imagePath: string) => { const image = textures[imagePath]; if (image) { return image; } const image2 = textures[imagePath] = new Image(); image2.src = imagePath; return image2; }
playpuppy/matter-ts
src/render.ts
TypeScript
ArrowFunction
(time: number) => { this.frameRequestId = _requestAnimationFrame(loop); this.draw(); }
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Continuously updates the render canvas on the `requestAnimationFrame` event. * @method run * @param {render} this */ public run() { if (_requestAnimationFrame !== undefined) { const loop = (time: number) => { this.frameRequestId = _requestAnimationFrame(loop); this.draw(); ...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Ends execution of `Render.run` on the given `render`, by canceling the animation frame request event loop. * @method stop * @param {render} render */ public stop() { if (_cancelAnimationFrame !== undefined) { _cancelAnimationFrame(this.frameRequestId); } }
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Sets the pixel ratio of the renderer and updates the canvas. * To automatically detect the correct ratio, pass the string `'auto'` for `pixelRatio`. * @method setPixelRatio * @param {render} this * @param {number} pixelRatio */ private setPixelRatio(pixelRatio?: number) { var options = this....
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Positions and sizes the viewport around the given object bounds. * Objects must have at least one of the following properties: * - `object.bounds` * - `object.position` * - `object.min` and `object.max` * - `object.x` and `object.y` * @method lookAt * @param {render} this * @param {obje...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Applies viewport transforms based on `render.bounds` to a render context. * @method startViewTransform * @param {render} this */ public startViewTransform() { var boundsWidth = this.bounds.max.x - this.bounds.min.x, boundsHeight = this.bounds.max.y - this.bounds.min.y, boundsScaleX = b...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Resets all transforms on the render context. * @method endViewTransform * @param {render} render */ public endViewTransform() { this.context.setTransform(this.options.pixelRatio, 0, 0, this.options.pixelRatio, 0, 0); }
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
public draw() { const engine = this.engine; const world = engine.world; const canvas = this.canvas; const context = this.context; const options = this.options; const allBodies = world.allBodies(); const allConstraints = world.allConstraints(); const background = options.wireframes ? opt...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Applies the background to the canvas using CSS. * @method applyBackground * @private * @param {render} render * @param {string} background */ private applyBackground(background: string) { var cssBackground = background; if (/(jpg|gif|png)$/.test(background)) cssBackground = 'url(' + back...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method debug * @param {render} this * @param {RenderingContext} context */ private debug(context: CanvasRenderingContext2D) { var c = context, engine = this.engine, world = engine.world, // metrics = engine.metrics, options = this.options, ...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method constraints * @param {constraint[]} constraints * @param {RenderingContext} context */ private static constraints(constraints: Constraint[], context: CanvasRenderingContext2D) { var c = context; for (var i = 0; i < constraints.length; i++) { var co...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method bodyShadows * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyShadows(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, engine = this.engine; for (var i = 0; i < bodies.lengt...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method bodies * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodies(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, engine = this.engine, options = this.options, showInterna...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Optimised method for drawing body wireframes in one pass * @private * @method bodyWireframes * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyWireframes(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, showIntern...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Optimised method for drawing body convex hull wireframes in one pass * @private * @method bodyConvexHulls * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyConvexHulls(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, ...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Renders body vertex numbers. * @private * @method vertexNumbers * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private vertexNumbers(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, i, j, k; for (i = 0; ...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Renders mouse position. * @private * @method mousePosition * @param {render} render * @param {mouse} mouse * @param {RenderingContext} context */ private mousePosition(mouse: any, context: CanvasRenderingContext2D) { var c = context; c.fillStyle = 'rgba(255,255,255,0.8)'; c.fillTe...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Draws body bounds * @private * @method bodyBounds * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyBounds(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, engine = this.engine, options = this.options; ...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Draws body angle indicators and axes * @private * @method bodyAxes * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyAxes(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, engine = this.engine, options = th...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Draws body positions * @private * @method bodyPositions * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyPositions(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, engine = this.engine, options = this.opt...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Draws body velocity * @private * @method bodyVelocity * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyVelocity(bodies: Body[], context: CanvasRenderingContext2D) { var c = context; c.beginPath(); for (var i = 0; i < bodies.lengt...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Draws body ids * @private * @method bodyIds * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyIds(bodies: Body[], context: CanvasRenderingContext2D) { var c = context, i, j; for (i = 0; i < bodies.length; i++) { if (!...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method collisions * @param {render} render * @param {pair[]} pairs * @param {RenderingContext} context */ private collisions(pairs: Pair[], context: CanvasRenderingContext2D) { var c = context, options = this.options, pair, collision, corr...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method separations * @param {render} render * @param {pair[]} pairs * @param {RenderingContext} context */ private separations(pairs: Pair[], context: CanvasRenderingContext2D) { var c = context, options = this.options, pair, collision, co...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method grid * @param {render} this * @param {grid} grid * @param {RenderingContext} context */ private grid(grid: Grid, context: CanvasRenderingContext2D) { var c = context, options = this.options; if (options.wireframes) { c.strokeStyle = 'rgba(...
playpuppy/matter-ts
src/render.ts
TypeScript
MethodDeclaration
/** * Description * @private * @method inspector * @param {inspector} inspector * @param {RenderingContext} context */ private inspector(inspector: any, context: CanvasRenderingContext2D) { var engine = inspector.engine, selected = inspector.selected, render = inspector.render, o...
playpuppy/matter-ts
src/render.ts
TypeScript
ArrowFunction
() => ( <div> <Label>I
AvinaLakshmi/sp-dev-fx-controls-react
node_modules/@microsoft/office-ui-fabric-react-bundle/node_modules/office-ui-fabric-react/src/components/Label/examples/Label.Basic.Example.tsx
TypeScript
FunctionDeclaration
export function getFamily(runtime: string | undefined): SamLambdaRuntimeFamily { switch (runtime) { case 'python3.7': case 'python3.6': case 'python2.7': case 'python': return SamLambdaRuntimeFamily.Python case 'nodejs8.10': case 'nodejs10.x': cas...
PseudoAj/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
function getSortableCompareText(runtime: SamLambdaRuntime): string { return runtimeCompareText.get(runtime) || runtime.toString() }
PseudoAj/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
export function compareSamLambdaRuntime(a: SamLambdaRuntime, b: SamLambdaRuntime): number { return getSortableCompareText(a).localeCompare(getSortableCompareText(b)) }
PseudoAj/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
EnumDeclaration
export enum SamLambdaRuntimeFamily { Python, NodeJS, DotNetCore }
PseudoAj/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
TypeAliasDeclaration
// TODO: Can we dynamically determine the available runtimes? We could theoretically parse the // output of `sam init --help`, but that's a hack. export type SamLambdaRuntime = 'python3.7' | 'python3.6' | 'python2.7' | 'nodejs8.10' | 'nodejs10.x' | 'dotnetcore2.1'
PseudoAj/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
ArrowFunction
() => { this._elementRef.nativeElement.appendChild(this._img); this._loaded(true); }
Amonratchantawon/ecommerce-by-ass
src/components/preload-image/preload-image.ts
TypeScript
ClassDeclaration
@Component({ selector: 'preload-image', templateUrl: 'preload-image.html' }) export class PreloadImage implements OnChanges { _src: string = ''; _ratio: { w: number, h: number }; _img: any; constructor(public _elementRef: ElementRef, public _renderer: Renderer) { this._img = new Image(); } @Input() a...
Amonratchantawon/ecommerce-by-ass
src/components/preload-image/preload-image.ts
TypeScript
MethodDeclaration
ngOnChanges(changes: { [propName: string]: SimpleChange }) { let ratio_height = (this._ratio.h / this._ratio.w * 100)+"%"; // Conserve aspect ratio (see: http://stackoverflow.com/a/10441480/1116959) this._renderer.setElementStyle(this._elementRef.nativeElement, 'padding-bottom', ratio_height); this._updat...
Amonratchantawon/ecommerce-by-ass
src/components/preload-image/preload-image.ts
TypeScript
MethodDeclaration
_update() { if (isPresent(this.alt)) { this._img.alt = this.alt; } if (isPresent(this.title)) { this._img.title = this.title; } this._img.addEventListener('load', () => { this._elementRef.nativeElement.appendChild(this._img); this._loaded(true); }); this._img.src = this._src; ...
Amonratchantawon/ecommerce-by-ass
src/components/preload-image/preload-image.ts
TypeScript
MethodDeclaration
_loaded(isLoaded: boolean) { this._elementRef.nativeElement.classList[isLoaded ? 'add' : 'remove']('img-loaded'); }
Amonratchantawon/ecommerce-by-ass
src/components/preload-image/preload-image.ts
TypeScript
ArrowFunction
(): JSX.Element => ( <DemoContainer title="String Item"> <PropertyItemString onChange
Gulbrandr/alva
packages/components/src/property-item-string/demo.tsx
TypeScript
ArrowFunction
() => { const [orphanages, setOrphanages] = useState<Orphanage[]>([]); useEffect(() => { (async () => { const { data } = await api.get<Orphanage[]>('/orphanages'); setOrphanages(data); })(); }, []); return ( <Container> <aside> <header> <img src={MapMarkerImg} a...
RodrigoSSilverio/HappyNWL
src/pages/OrphanagesMap/index.tsx
TypeScript
ArrowFunction
() => { (async () => { const { data } = await api.get<Orphanage[]>('/orphanages'); setOrphanages(data); })(); }
RodrigoSSilverio/HappyNWL
src/pages/OrphanagesMap/index.tsx
TypeScript
ArrowFunction
async () => { const { data } = await api.get<Orphanage[]>('/orphanages'); setOrphanages(data); }
RodrigoSSilverio/HappyNWL
src/pages/OrphanagesMap/index.tsx
TypeScript
ArrowFunction
orphanage => ( <Marker key={orphanage.id}
RodrigoSSilverio/HappyNWL
src/pages/OrphanagesMap/index.tsx
TypeScript
InterfaceDeclaration
interface Orphanage { id: number; name: string; latitude: number; longitude: number; }
RodrigoSSilverio/HappyNWL
src/pages/OrphanagesMap/index.tsx
TypeScript
ArrowFunction
async () => { try { const PORT = process.env.SERVER_PORT || 5000; const app = await NestFactory.create(AppModule); app.enableCors(); await app.listen(PORT, () => { console.log(`server started on PORT: ${PORT}`); }) } catch (error) { console.log(error)...
MuscularSloth/music-platform-api
src/main.ts
TypeScript
ArrowFunction
() => { console.log(`server started on PORT: ${PORT}`); }
MuscularSloth/music-platform-api
src/main.ts
TypeScript
ClassDeclaration
export class OpenZeppelinExtensionAdapter implements IExtensionAdapter { private extensionInfo: any; private extension: Extension<any> | undefined; constructor() { this.extensionInfo = Constants.externalExtensions[Constants.coreSdk.openZeppelin]; this.extension = extensions.getExtension(this.extensionIn...
MHMYunos2020/vscode-azure-blockchain-ethereum
src/services/extensionAdapter/OpenZeppelinExtensionAdapter.ts
TypeScript
MethodDeclaration
public async validateExtension(): Promise<void> { if (!this.extension) { throw new Error(Constants.errorMessageStrings.ExtensionNotInstalled(this.extensionInfo.name)); } const version = this.extension.packageJSON.version; if (!semver.eq(version, this.extensionInfo.supportedVersion)) { thro...
MHMYunos2020/vscode-azure-blockchain-ethereum
src/services/extensionAdapter/OpenZeppelinExtensionAdapter.ts
TypeScript
MethodDeclaration
public async build(): Promise<void> { return commands.executeCommand(this.extensionInfo.commands.buildContracts); }
MHMYunos2020/vscode-azure-blockchain-ethereum
src/services/extensionAdapter/OpenZeppelinExtensionAdapter.ts
TypeScript
MethodDeclaration
public async deploy(): Promise<void> { return commands.executeCommand(this.extensionInfo.commands.deployContracts); }
MHMYunos2020/vscode-azure-blockchain-ethereum
src/services/extensionAdapter/OpenZeppelinExtensionAdapter.ts
TypeScript
FunctionDeclaration
export declare function maskSchema(schema: string): string;
Dazpel/redwoodjs
node_modules/@prisma/sdk/dist/utils/maskSchema.d.ts
TypeScript
FunctionDeclaration
export declare function mapScalarValues(obj: any, mapper: (value: any) => any): {};
Dazpel/redwoodjs
node_modules/@prisma/sdk/dist/utils/maskSchema.d.ts
TypeScript
ClassDeclaration
/** * Cloud Logging API * * Writes log entries and manages your Cloud Logging configuration. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the documentation at https://cloud.google.com/logging/doc...
GumballWatterson00/DevCBatch1Project
node_modules/googleapis/build/src/apis/logging/v2.d.ts
TypeScript
ClassDeclaration
export class Resource$Billingaccounts { context: APIRequestContext; buckets: Resource$Billingaccounts$Buckets; exclusions: Resource$Billingaccounts$Exclusions; locations: Resource$Billingaccounts$Locations; logs: Resource$Billingaccounts$Logs; sinks: Resource$Billingacco...
GumballWatterson00/DevCBatch1Project
node_modules/googleapis/build/src/apis/logging/v2.d.ts
TypeScript
ClassDeclaration
export class Resource$Billingaccounts$Buckets { context: APIRequestContext; constructor(context: APIRequestContext); /** * logging.billingAccounts.buckets.get * @desc Gets a bucket (Beta). * @example * // Before running the sample: * // - Enable the ...
GumballWatterson00/DevCBatch1Project
node_modules/googleapis/build/src/apis/logging/v2.d.ts
TypeScript
ClassDeclaration
export class Resource$Billingaccounts$Locations { context: APIRequestContext; buckets: Resource$Billingaccounts$Locations$Buckets; constructor(context: APIRequestContext); }
GumballWatterson00/DevCBatch1Project
node_modules/googleapis/build/src/apis/logging/v2.d.ts
TypeScript