type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
FunctionDeclaration
/** * Helper function to create a {@link vscode.Task Task} with the given parameters. */ export function createSwiftTask(args: string[], name: string, config?: TaskConfig): vscode.Task { const swift = getSwiftExecutable(); const task = new vscode.Task( { type: "swift", command: swift, args: args }, config?.scope ?? vscode.TaskScope.Workspace, name, "swift", new vscode.ShellExecution(swift, args), config?.problemMatcher ); // This doesn't include any quotes added by VS Code. // See also: https://github.com/microsoft/vscode/issues/137895 task.detail = `swift ${args.join(" ")}`; task.group = config?.group; task.presentationOptions = config?.presentationOptions ?? {}; return task; }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
FunctionDeclaration
/* * Execute swift command as task and wait until it is finished */ export async function executeSwiftTaskAndWait(args: string[], name: string, config?: TaskConfig) { const swift = getSwiftExecutable(); const task = new vscode.Task( { type: "swift", command: "swift", args: args }, config?.scope ?? vscode.TaskScope.Workspace, name, "swift", new vscode.ShellExecution(swift, args), config?.problemMatcher ); task.group = config?.group; task.presentationOptions = config?.presentationOptions ?? {}; executeTaskAndWait(task); }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
FunctionDeclaration
/* * Execute shell command as task and wait until it is finished */ export async function executeShellTaskAndWait( command: string, args: string[], name: string, config?: TaskConfig ) { const task = new vscode.Task( { type: "swift", command: command, args: args }, config?.scope ?? vscode.TaskScope.Workspace, name, "swift", new vscode.ShellExecution(command, args), config?.problemMatcher ); task.group = config?.group; task.presentationOptions = config?.presentationOptions ?? {}; executeTaskAndWait(task); }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
FunctionDeclaration
/* * Execute task and wait until it is finished. This function assumes that no * other tasks with the same name will be run at the same time */ export async function executeTaskAndWait(task: vscode.Task) { return new Promise<void>(resolve => { const disposable = vscode.tasks.onDidEndTask(({ execution }) => { if (execution.task.name === task.name && execution.task.scope === task.scope) { disposable.dispose(); resolve(); } }); vscode.tasks.executeTask(task); }); }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
ArrowFunction
resolve => { const disposable = vscode.tasks.onDidEndTask(({ execution }) => { if (execution.task.name === task.name && execution.task.scope === task.scope) { disposable.dispose(); resolve(); } }); vscode.tasks.executeTask(task); }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
ArrowFunction
({ execution }) => { if (execution.task.name === task.name && execution.task.scope === task.scope) { disposable.dispose(); resolve(); } }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
ClassDeclaration
/** * A {@link vscode.TaskProvider TaskProvider} for tasks that match the definition * in **package.json**: `{ type: 'swift'; command: string; args: string[] }`. * * See {@link SwiftTaskProvider.provideTasks provideTasks} for a list of provided tasks. */ export class SwiftTaskProvider implements vscode.TaskProvider { static buildAllName = "Build All"; static cleanBuildName = "Clean Build Artifacts"; static resolvePackageName = "Resolve Package Dependencies"; static updatePackageName = "Update Package Dependencies"; constructor(private workspaceContext: WorkspaceContext) {} /** * Provides tasks to run the following commands: * * - `swift build` * - `swift package clean` * - `swift package resolve` * - `swift package update` * - `swift run ${target}` for every executable target */ // eslint-disable-next-line @typescript-eslint/no-unused-vars async provideTasks(token: vscode.CancellationToken): Promise<vscode.Task[]> { if (this.workspaceContext.folders.length === 0) { return []; } const tasks = []; for (const folderContext of this.workspaceContext.folders) { if (!folderContext.swiftPackage.foundPackage) { continue; } tasks.push(createBuildAllTask(folderContext.folder)); const executables = folderContext.swiftPackage.executableProducts; for (const executable of executables) { tasks.push(...createBuildTasks(executable, folderContext.folder)); } } return tasks; } /** * Resolves a {@link vscode.Task Task} specified in **tasks.json**. * * Other than its definition, this `Task` may be incomplete, * so this method should fill in the blanks. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars resolveTask(task: vscode.Task, token: vscode.CancellationToken): vscode.Task { // We need to create a new Task object here. // Reusing the task parameter doesn't seem to work. const newTask = new vscode.Task( task.definition, task.scope ?? vscode.TaskScope.Workspace, task.name || "Custom Task", "swift", new vscode.ShellExecution(task.definition.command, task.definition.args), task.problemMatchers ); newTask.detail = task.detail ?? `${task.definition.command} ${task.definition.args.join(" ")}`; newTask.group = task.group; newTask.presentationOptions = task.presentationOptions; return newTask; } }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
InterfaceDeclaration
/** * References: * * - General information on tasks: * https://code.visualstudio.com/docs/editor/tasks * - Contributing task definitions: * https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions * - Implementing task providers: * https://code.visualstudio.com/api/extension-guides/task-provider */ // Interface class for defining task configuration interface TaskConfig { scope?: vscode.TaskScope | vscode.WorkspaceFolder; group?: vscode.TaskGroup; problemMatcher?: string | string[]; presentationOptions?: vscode.TaskPresentationOptions; }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
MethodDeclaration
/** * Provides tasks to run the following commands: * * - `swift build` * - `swift package clean` * - `swift package resolve` * - `swift package update` * - `swift run ${target}` for every executable target */ // eslint-disable-next-line @typescript-eslint/no-unused-vars async provideTasks(token: vscode.CancellationToken): Promise<vscode.Task[]> { if (this.workspaceContext.folders.length === 0) { return []; } const tasks = []; for (const folderContext of this.workspaceContext.folders) { if (!folderContext.swiftPackage.foundPackage) { continue; } tasks.push(createBuildAllTask(folderContext.folder)); const executables = folderContext.swiftPackage.executableProducts; for (const executable of executables) { tasks.push(...createBuildTasks(executable, folderContext.folder)); } } return tasks; }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
MethodDeclaration
/** * Resolves a {@link vscode.Task Task} specified in **tasks.json**. * * Other than its definition, this `Task` may be incomplete, * so this method should fill in the blanks. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars resolveTask(task: vscode.Task, token: vscode.CancellationToken): vscode.Task { // We need to create a new Task object here. // Reusing the task parameter doesn't seem to work. const newTask = new vscode.Task( task.definition, task.scope ?? vscode.TaskScope.Workspace, task.name || "Custom Task", "swift", new vscode.ShellExecution(task.definition.command, task.definition.args), task.problemMatchers ); newTask.detail = task.detail ?? `${task.definition.command} ${task.definition.args.join(" ")}`; newTask.group = task.group; newTask.presentationOptions = task.presentationOptions; return newTask; }
compnerd/vscode-swift
src/SwiftTaskProvider.ts
TypeScript
FunctionDeclaration
export default function WalletCreateList() { const history = useHistory(); const { url } = useRouteMatch(); function handleCreateDistributedIdentity() { history.push(`${url}/did`); } return ( <Flex flexDirection="column" gap={3}> <Flex flexGrow={1}> <Typography variant="h5"> <Trans>Select Wallet Type</Trans> </Typography> </Flex> <Grid spacing={3} alignItems="stretch" container> <Grid xs={12} sm={6} md={4} item> <WalletCreateCard onSelect={handleCreateDistributedIdentity} title={<Trans>Distributed Identity</Trans>} icon={<ShareIcon fontSize="large" color="primary" />}
AmineKhaldi/chia-blockchain-gui
src/components/wallet/create/WalletCreateList.tsx
TypeScript
FunctionDeclaration
function handleCreateDistributedIdentity() { history.push(`${url}/did`); }
AmineKhaldi/chia-blockchain-gui
src/components/wallet/create/WalletCreateList.tsx
TypeScript
ClassDeclaration
@Component({ selector: 'notification-item', templateUrl: './notification-item.component.html', styleUrls: ['./notification-item.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class NotificationItemComponent { @Input() notification: Notification; private errorMessage = "This url doesn't exist."; constructor(private router: Router, private service: NotificationService) {} public goToPath() { try { this.router.navigate([this.notification.path]); this.service.readNotification(this.notification.id); } catch (error) { console.error(error); throw new Error(this.errorMessage); } } public goToTeamwork() { try { this.router.navigate([this.notification.path]); this.service.readNotification(this.notification.id); } catch (error) { console.error(error); throw new Error(this.errorMessage); } } public read() { this.service.readNotification(this.notification.id); } }
ioaNikas/blockframes
libs/notification/src/lib/notification/notification-item/notification-item.component.ts
TypeScript
MethodDeclaration
public goToPath() { try { this.router.navigate([this.notification.path]); this.service.readNotification(this.notification.id); } catch (error) { console.error(error); throw new Error(this.errorMessage); } }
ioaNikas/blockframes
libs/notification/src/lib/notification/notification-item/notification-item.component.ts
TypeScript
MethodDeclaration
public goToTeamwork() { try { this.router.navigate([this.notification.path]); this.service.readNotification(this.notification.id); } catch (error) { console.error(error); throw new Error(this.errorMessage); } }
ioaNikas/blockframes
libs/notification/src/lib/notification/notification-item/notification-item.component.ts
TypeScript
MethodDeclaration
public read() { this.service.readNotification(this.notification.id); }
ioaNikas/blockframes
libs/notification/src/lib/notification/notification-item/notification-item.component.ts
TypeScript
ClassDeclaration
export class Tenderfoot extends Unit { protected baseAttributes = new Attributes(); color: Color.ColorName = 'Neutral'; spec: Color.Spec = 'Starter'; flavorType = 'Virtuoso'; name: string = 'Tenderfoot'; techLevel: TechLevel = 0; importPath: string = './neutral/starter'; constructor(owner: number, controller?: number, cardId?: string) { super(owner, controller, cardId); this.baseAttributes.cost = 1; this.baseAttributes.attack = 2; this.baseAttributes.health = 1; } }
rgraciano/codex
src/cards/neutral/starter/Tenderfoot.ts
TypeScript
FunctionDeclaration
/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */ function onlySuccessful(statusCode: string) { return successfulCodes.includes(statusCode); }
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
FunctionDeclaration
/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */ function getSuccessfulResponse(op: HttpOperation): SwaggerType { const definedSuccessCodes = Object.keys(op.responses).filter(onlySuccessful); if (definedSuccessCodes.length === 0) { throw new Error("No success responses defined"); } return op.responses[definedSuccessCodes[0]]; }
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
FunctionDeclaration
/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */ export function getSuccessfulResponseType( op: HttpOperation, swagger: Swagger ): [string, boolean] { let successfulResponseTypeIsRef = false; let successfulResponseType; try { const successfulResponse = getSuccessfulResponse(op); const convertedType = convertType(successfulResponse, swagger); if (convertedType.target) { successfulResponseTypeIsRef = true; } successfulResponseType = convertedType.target || convertedType.tsType || defaultResponseType; } catch (error) { successfulResponseType = defaultResponseType; } return [successfulResponseType, successfulResponseTypeIsRef]; }
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( responseTypeName: string, httpOperation: HttpOperation, swagger: Swagger ): string => uniq( responseTypesToStrings( responseTypeName, convertResponseTypes(responseTypes(httpOperation), swagger) ) ).join(" | ")
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( httpOperation: HttpOperation ): ResponseType<SwaggerType>[] => entries(httpOperation.responses).map(kvp => ({ statusType: kvp[0], bodyType: kvp[1] }))
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
kvp => ({ statusType: kvp[0], bodyType: kvp[1] })
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( swaggerTypes: ResponseType<SwaggerType>[], swagger: Swagger ): ResponseType<TypeSpec>[] => swaggerTypes.map(swaggerType => convertResponseType(swaggerType, swagger))
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
swaggerType => convertResponseType(swaggerType, swagger)
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( swaggerType: ResponseType<SwaggerType>, swagger: Swagger ): ResponseType<TypeSpec> => ({ statusType: convertStatusType(swaggerType.statusType), bodyType: convertType(swaggerType.bodyType, swagger) })
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
(str: string): string => isHttpStatusCode(str) ? str : defaultHttpStatusType
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
(str: string): boolean => str.match(/^[1-5]\d{2}$/) !== null
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( responseTypeName: string, typeSpecs: ResponseType<TypeSpec>[] ): string[] => typeSpecs.map(ts => responseTypeToString(responseTypeName, ts))
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
ts => responseTypeToString(responseTypeName, ts)
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
( responseTypeName: string, typeSpec: ResponseType<TypeSpec> ): string => `${responseTypeName}<${typeSpec.statusType}, ${typeSpecToString( typeSpec.bodyType )}>`
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
ArrowFunction
(typeSpec: TypeSpec): string => typeSpec.target || typeSpec.tsType || defaultResponseType
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
InterfaceDeclaration
interface ResponseType<T> { statusType: string; bodyType: T; }
IZEDx/swagger-typescript-codegen
src/view-data/responseType.ts
TypeScript
InterfaceDeclaration
/** * Interface for the jqXHR object */ interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> { /** * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). */ overrideMimeType(mimeType: string): any; /** * Cancel the request. * * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" */ abort(statusText?: string): void; /** * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. */ then<R>(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<R>; /** * Property containing the parsed response if the response Content-Type is json */ responseJSON?: any; /** * A function to be called if the request fails. */ error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Interface for the JQuery callback */ interface JQueryCallback { /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function): JQueryCallback; /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function[]): JQueryCallback; /** * Disable a callback list from doing anything more. */ disable(): JQueryCallback; /** * Determine if the callbacks list has been disabled. */ disabled(): boolean; /** * Remove all of the callbacks from a list. */ empty(): JQueryCallback; /** * Call all of the callbacks with the given arguments * * @param arguments The argument or list of arguments to pass back to the callback list. */ fire(...arguments: any[]): JQueryCallback; /** * Determine if the callbacks have already been called at least once. */ fired(): boolean; /** * Call all callbacks in a list with the given context and arguments. * * @param context A reference to the context in which the callbacks in the list should be fired. * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. */ fireWith(context?: any, args?: any[]): JQueryCallback; /** * Determine whether a supplied callback is in a list * * @param callback The callback to search for. */ has(callback: Function): boolean; /** * Lock a callback list in its current state. */ lock(): JQueryCallback; /** * Determine if the callbacks list has been locked. */ locked(): boolean; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function): JQueryCallback; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function[]): JQueryCallback; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Allows jQuery Promises to interop with non-jQuery promises */ interface JQueryGenericPromise<T> { /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Interface for the JQuery promise/deferred callbacks */ interface JQueryPromiseCallback<T> { (value?: T, ...args: any[]): void; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryPromiseOperator<T, U> { (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Interface for the JQuery promise, part of callbacks */ interface JQueryPromise<T> extends JQueryGenericPromise<T> { /** * Determine the current state of a Deferred object. */ state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Interface for the JQuery deferred, part of callbacks */ interface JQueryDeferred<T> extends JQueryGenericPromise<T> { /** * Determine the current state of a Deferred object. */ state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; /** * Call the progressCallbacks on a Deferred object with the given args. * * @param args Optional arguments that are passed to the progressCallbacks. */ notify(value?: any, ...args: any[]): JQueryDeferred<T>; /** * Call the progressCallbacks on a Deferred object with the given context and args. * * @param context Context passed to the progressCallbacks as the this object. * @param args Optional arguments that are passed to the progressCallbacks. */ notifyWith(context: any, value?: any[]): JQueryDeferred<T>; /** * Reject a Deferred object and call any failCallbacks with the given args. * * @param args Optional arguments that are passed to the failCallbacks. */ reject(value?: any, ...args: any[]): JQueryDeferred<T>; /** * Reject a Deferred object and call any failCallbacks with the given context and args. * * @param context Context passed to the failCallbacks as the this object. * @param args An optional array of arguments that are passed to the failCallbacks. */ rejectWith(context: any, value?: any[]): JQueryDeferred<T>; /** * Resolve a Deferred object and call any doneCallbacks with the given args. * * @param value First argument passed to doneCallbacks. * @param args Optional subsequent arguments that are passed to the doneCallbacks. */ resolve(value?: T, ...args: any[]): JQueryDeferred<T>; /** * Resolve a Deferred object and call any doneCallbacks with the given context and args. * * @param context Context passed to the doneCallbacks as the this object. * @param args An optional array of arguments that are passed to the doneCallbacks. */ resolveWith(context: any, value?: T[]): JQueryDeferred<T>; /** * Return a Deferred's Promise object. * * @param target Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise<T>; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Interface of the JQuery extension of the W3C event object */ interface BaseJQueryEventObject extends Event { data: any; delegateTarget: Element; isDefaultPrevented(): boolean; isImmediatePropagationStopped(): boolean; isPropagationStopped(): boolean; namespace: string; originalEvent: Event; preventDefault(): any; relatedTarget: Element; result: any; stopImmediatePropagation(): void; stopPropagation(): void; target: Element; pageX: number; pageY: number; which: number; metaKey: boolean; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryMouseEventObject extends JQueryInputEventObject { button: number; clientX: number; clientY: number; offsetX: number; offsetY: number; pageX: number; pageY: number; screenX: number; screenY: number; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryKeyEventObject extends JQueryInputEventObject { char: any; charCode: number; key: any; keyCode: number; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/* Collection of properties of the current browser */ interface JQuerySupport { ajax?: boolean; boxModel?: boolean; changeBubbles?: boolean; checkClone?: boolean; checkOn?: boolean; cors?: boolean; cssFloat?: boolean; hrefNormalized?: boolean; htmlSerialize?: boolean; leadingWhitespace?: boolean; noCloneChecked?: boolean; noCloneEvent?: boolean; opacity?: boolean; optDisabled?: boolean; optSelected?: boolean; scriptEval? (): boolean; style?: boolean; submitBubbles?: boolean; tbody?: boolean; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryParam { /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj An array or object to serialize. */ (obj: any): string; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj An array or object to serialize. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. */ (obj: any, traditional: boolean): string; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * The interface used to construct jQuery events (with $.Event). It is * defined separately instead of inline in JQueryStatic to allow * overriding the construction function with specific strings * returning specific event objects. */ interface JQueryEventConstructor { (name: string, eventProperties?: any): JQueryEventObject; new (name: string, eventProperties?: any): JQueryEventObject; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * The interface used to specify coordinates. */ interface JQueryCoordinates { left: number; top: number; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
/** * Elements in the array returned by serializeArray() */ interface JQuerySerializeArrayElement { name: string; value: string; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryAnimationOptions { /** * A string or number determining how long the animation will run. */ duration?: any; /** * A string indicating which easing function to use for the transition. */ easing?: string; /** * A function to call once the animation is complete. */ complete?: Function; /** * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. */ step?: (now: number, tween: any) => any; /** * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) */ progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any; /** * A function to call when the animation begins. (version added: 1.8) */ start?: (animation: JQueryPromise<any>) => any; /** * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) */ done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; /** * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) */ fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; /** * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) */ always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; /** * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. */ queue?: any; /** * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) */ specialEasing?: Object; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryEasingFunction { ( percent: number ): number; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
InterfaceDeclaration
interface JQueryEasingFunctions { [ name: string ]: JQueryEasingFunction; linear: JQueryEasingFunction; swing: JQueryEasingFunction; }
Gubancs/chess-profile
src/main/webapp/resources/dts/jquery.d.ts
TypeScript
FunctionDeclaration
// 将html字符串解析成jQuery对象 function parseHtml(html_str: string) { let nodes = $.parseHTML(html_str, null, true); let elem; if (nodes.length != 1) elem = $(document.createElement('div')).append(nodes); else elem = $(nodes[0]); return elem; }
DogWars/PyWebIO
webiojs/src/models/output.ts
TypeScript
FunctionDeclaration
export function getWidgetElement(spec: any) { if (!(spec.type in type2widget)) throw Error("Unknown type in getWidgetElement() :" + spec.type); let elem = type2widget[spec.type].get_element(spec); if (spec.style) { let old_style = elem.attr('style') || ''; elem.attr({"style": old_style + spec.style}); } return elem; }
DogWars/PyWebIO
webiojs/src/models/output.ts
TypeScript
FunctionDeclaration
// 将output指令的spec字段解析成html字符串 export function outputSpecToHtml(spec: any) { let html = ''; try { let nodes = getWidgetElement(spec); for (let node of nodes) html += node.outerHTML || ''; } catch (e) { console.error('Get sub widget html error,', e, spec); } return html; }
DogWars/PyWebIO
webiojs/src/models/output.ts
TypeScript
InterfaceDeclaration
/* * 当前限制 * 若Widget被作为其他Widget的子项时,该Widget中绑定的事件将会失效 * */ export interface Widget { handle_type: string; get_element(spec: any): JQuery; }
DogWars/PyWebIO
webiojs/src/models/output.ts
TypeScript
InterfaceDeclaration
interface itemType { data: string, col?: number, row?: number }
DogWars/PyWebIO
webiojs/src/models/output.ts
TypeScript
FunctionDeclaration
declare function SimpleSelect(props: SimpleSelectProps & React.RefAttributes<HTMLInputElement>): JSX.Element;
gregor-gh/carbon
src/components/select/simple-select/simple-select.d.ts
TypeScript
InterfaceDeclaration
export interface SimpleSelectProps extends FormInputPropTypes { /** Child components (such as Option or OptionRow) for the SelectList */ children: React.ReactNode; /** The default selected value(s), when the component is operating in uncontrolled mode */ defaultValue?: string | object; /** Boolean to toggle where SelectList is rendered in relation to the Select Input */ disablePortal?: boolean; /** If true the loader animation is displayed in the option list */ isLoading?: boolean; /** When true component will work in multi column mode. * Children should consist of OptionRow components in this mode */ multiColumn?: boolean; /** A callback that is triggered when a user scrolls to the bottom of the list */ onListScrollBottom?: () => void; /** A custom callback for when the dropdown menu opens */ onOpen?: () => void; /** If true the Component opens on focus */ openOnFocus?: boolean; /** A custom message to be displayed when any option does not match the filter text */ noResultsMessage?: string; /** SelectList table header, should consist of multiple th elements. * Works only in multiColumn mode */ tableHeader?: React.ReactNode; /** If true the component input has no border and is transparent */ transparent?: boolean; /** The selected value(s), when the component is operating in controlled mode */ value?: string | object; }
gregor-gh/carbon
src/components/select/simple-select/simple-select.d.ts
TypeScript
ArrowFunction
(flag: string): boolean => { const context = useContext(ReactSimpleFlagsContext) if (!context) return false const match = context?.find((f) => f.name === flag) if (!match) return false return Boolean(match.enabled) }
emileaublet/react-simple-flags
src/hook.tsx
TypeScript
ArrowFunction
(f) => f.name === flag
emileaublet/react-simple-flags
src/hook.tsx
TypeScript
ArrowFunction
({ authData, authRoute, children, }) => { return ( <AuthStateContext.Provider value={{ authData, authRoute: authRoute ?? AuthRoute.SignIn, dispatchAuthState, }}
dkershner6/amplify-authenticator-react-custom
src/test/TestWrapper.tsx
TypeScript
ArrowFunction
({ user, ...props }) => { if (props.isAuthenticated === isAuthenticated.True) { if (!user) { props.getUser(); return <div>...Getting User...</div> } const values = queryString.parse(props.location.search) if (values.userType) { let userType:UserLoginType = parseInt(values.userType as string); if (userType === UserLoginType.Student) { return <Redirect to="/play/dashboard" /> } else if (userType === UserLoginType.Builder) { return <Redirect to="/build" /> } } let path = props.location.pathname; let isAdmin = user.roles.some((role:any) => role.roleId === UserType.Admin); if (isAdmin) { if (path === '/build') { return <Redirect to="/build" /> } else if (path === '/play') { return <Redirect to="/play/dashboard" /> } } let canBuild = user.roles.some((role:any) => role.roleId === UserType.Admin || role.roleId === UserType.Builder || role.roleId === UserType.Editor ); if (canBuild) { return <Redirect to="/build" /> } else { return <Redirect to="/play/dashboard" /> } } else if (props.isAuthenticated === isAuthenticated.None) { props.isAuthorized(); return <div>...Checking rights...</div> } else { return <Redirect to="/choose-user" /> } }
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
(role:any) => role.roleId === UserType.Admin
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
(role:any) => role.roleId === UserType.Admin || role.roleId === UserType.Builder || role.roleId === UserType.Editor
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
(state: any) => { return { isAuthenticated: state.auth.isAuthenticated, user: state.user.user, } }
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
(dispatch: any) => { return { isAuthorized: () => dispatch(actions.isAuthorized()), getUser: () => dispatch(userActions.getUser()), } }
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
() => dispatch(actions.isAuthorized())
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
ArrowFunction
() => dispatch(userActions.getUser())
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
InterfaceDeclaration
interface AuthRedirectProps { isAuthenticated: isAuthenticated, user: User, getUser():void, isAuthorized():void, }
AminHussaini/brillder
src/components/app/AuthRedirectRoute.tsx
TypeScript
FunctionDeclaration
export function withThemeCreator<Theme = DefaultTheme>( option?: WithThemeCreatorOption<Theme> ): PropInjector<WithTheme<Theme>, ThemedComponentProps>;
GenaAiv/portfolio-website
node_modules/@material-ui/styles/withTheme/withTheme.d.ts
TypeScript
FunctionDeclaration
export default function withTheme< Theme, C extends React.ComponentType<ConsistentWith<React.ComponentProps<C>, WithTheme<Theme>>> >( component: C ): React.ComponentType< Omit<JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>, keyof WithTheme<Theme>> & Partial<WithTheme<Theme>> & ThemedComponentProps >;
GenaAiv/portfolio-website
node_modules/@material-ui/styles/withTheme/withTheme.d.ts
TypeScript
InterfaceDeclaration
export interface WithThemeCreatorOption<Theme = DefaultTheme> { defaultTheme?: Theme; }
GenaAiv/portfolio-website
node_modules/@material-ui/styles/withTheme/withTheme.d.ts
TypeScript
InterfaceDeclaration
export interface WithTheme<Theme = DefaultTheme> { theme: Theme; /** * Deprecated. Will be removed in v5. Refs are now automatically forwarded to * the inner component. * @deprecated since version 4.0 */ innerRef?: React.Ref<any>; }
GenaAiv/portfolio-website
node_modules/@material-ui/styles/withTheme/withTheme.d.ts
TypeScript
InterfaceDeclaration
export interface ThemedComponentProps extends Partial<WithTheme> { ref?: React.Ref<unknown>; }
GenaAiv/portfolio-website
node_modules/@material-ui/styles/withTheme/withTheme.d.ts
TypeScript
ClassDeclaration
@Component({ templateUrl: './chat.component.html', styleUrls: ['./chat.styles.scss'], }) export class ChatComponent implements OnInit { public messageForm: FormGroup; public get message() { return this.messageForm.get('message'); } constructor( public service: ChatService, private router: Router, ) {} public ngOnInit(): void { if (!this.service.registered) { this.router.navigate(['/']); return; } this.messageForm = new FormGroup({ message: new FormControl('') }); } public onSubmit() { if (this.message.value.trim().length) { this.service.connection.send({ type: 'message', message: this.message.value.trim() }); this.message.setValue(''); } } }
Zuzon/chat-app
src/app/chat/chat.component.ts
TypeScript
MethodDeclaration
public ngOnInit(): void { if (!this.service.registered) { this.router.navigate(['/']); return; } this.messageForm = new FormGroup({ message: new FormControl('') }); }
Zuzon/chat-app
src/app/chat/chat.component.ts
TypeScript
MethodDeclaration
public onSubmit() { if (this.message.value.trim().length) { this.service.connection.send({ type: 'message', message: this.message.value.trim() }); this.message.setValue(''); } }
Zuzon/chat-app
src/app/chat/chat.component.ts
TypeScript
FunctionDeclaration
export function Vec4Equals (a: IVec4Like, b: IVec4Like): boolean { return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w; }
CyberDex/phaser4
src/math/vec4/Vec4Equals.ts
TypeScript
ArrowFunction
({ children }) => { const [state, setState] = useState(false); const contextValue = { state, toggle: () => setState(!state), }; return ( <ToggleContext.Provider value={contextValue}> {children} </ToggleContext.Provider>
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
() => setState(!state)
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
() => useContext(ToggleContext)
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
() => useStateContext().state
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
props => { const { toggle } = useStateContext(); return <BaseButton {...props} onClick={toggle} />; }
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
(props: any) => ( <Page {...props}> <Layout> <SubTitle>Adding
CarlosTeixeiraCIANDT/Bodiless-JS
examples/test-site/src/data/pages/api/fclasses/index.tsx
TypeScript
ArrowFunction
() => { let component: AppCalendarHeaderComponent; let fixture: ComponentFixture<AppCalendarHeaderComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AppCalendarHeaderComponent ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(AppCalendarHeaderComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); }
djr-taureau/angular7-dotNetCore-starter
src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ declarations: [ AppCalendarHeaderComponent ] }) .compileComponents(); }
djr-taureau/angular7-dotNetCore-starter
src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(AppCalendarHeaderComponent); component = fixture.componentInstance; fixture.detectChanges(); }
djr-taureau/angular7-dotNetCore-starter
src/AspNetCoreSpa.Web/ClientApp/src/app/+examples/examples/calendar/calendar-header/calendar-header.component.spec.ts
TypeScript
ClassDeclaration
export abstract class WeightActivityData { abstract getWeightActivityData(period: string): Observable<WeightActive[]>; }
mschlech/beelogger-admin
src/app/@core/data/weight-activity.ts
TypeScript
InterfaceDeclaration
export interface WeightActive { date: string; pagesVisitCount: number; deltaUp: boolean; newVisits: number; }
mschlech/beelogger-admin
src/app/@core/data/weight-activity.ts
TypeScript
MethodDeclaration
abstract getWeightActivityData(period: string): Observable<WeightActive[]>;
mschlech/beelogger-admin
src/app/@core/data/weight-activity.ts
TypeScript
ClassDeclaration
export declare class UiIncentiveDataProviderFactory extends ContractFactory { constructor(signer?: Signer); static connect(address: string, signerOrProvider: Signer | Provider): UiIncentiveDataProvider; }
MorganIsBatman/aave-ui-caching-server
backend/@aave/contract-helpers/dist/cjs/ui-incentive-data-provider/typechain/UiIncentiveDataProviderFactory.d.ts
TypeScript
MethodDeclaration
static connect(address: string, signerOrProvider: Signer | Provider): UiIncentiveDataProvider;
MorganIsBatman/aave-ui-caching-server
backend/@aave/contract-helpers/dist/cjs/ui-incentive-data-provider/typechain/UiIncentiveDataProviderFactory.d.ts
TypeScript
ClassDeclaration
@Injectable() export class ModalService { constructor(private modalCtrl: ModalController, @Optional() private navParams: NavParams) { } getParam<T>(key: string): T { return this.navParams?.get(key); } async show(options: IModalOptions): Promise<IModal> { const modalOptions = { component: options.component, componentProps: options.props, cssClass: options.cssClass ? options.cssClass : [], backdropDismiss: options.backdropDismiss } as ModalOptions<any>; if (options.mode === "bottom") { (modalOptions.cssClass as string[]).push('smart-modal-bottom'); } const modal = await this.modalCtrl.create(modalOptions); await modal.present(); return modal as any; } async dismiss<T>(data: T = null): Promise<void> { await this.modalCtrl.dismiss(data); } }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript
InterfaceDeclaration
export interface IModalOptions { component; props?; mode?: 'default' | 'bottom'; cssClass?: string[]; backdropDismiss?: boolean; }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript
InterfaceDeclaration
export interface IModal { dismiss: () => void; onDidDismiss(): Promise<{ data: any }> }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript
MethodDeclaration
getParam<T>(key: string): T { return this.navParams?.get(key); }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript
MethodDeclaration
async show(options: IModalOptions): Promise<IModal> { const modalOptions = { component: options.component, componentProps: options.props, cssClass: options.cssClass ? options.cssClass : [], backdropDismiss: options.backdropDismiss } as ModalOptions<any>; if (options.mode === "bottom") { (modalOptions.cssClass as string[]).push('smart-modal-bottom'); } const modal = await this.modalCtrl.create(modalOptions); await modal.present(); return modal as any; }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript
MethodDeclaration
async dismiss<T>(data: T = null): Promise<void> { await this.modalCtrl.dismiss(data); }
AndriiBilych/smartsoft
libs/shared/angular/src/lib/services/modal/modal.service.ts
TypeScript