type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(id) => ( rows.filter((x) => ( x.groupId.toString() === id.toString() )) )
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript
ArrowFunction
(x) => ( x.groupId.toString() === id.toString() )
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript
ArrowFunction
(id) => ( rows.filter((x) => ( x._id.toString() === id.toString() )) )
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript
ArrowFunction
(x) => ( x._id.toString() === id.toString() )
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript
FunctionDeclaration
export function install(registers: EChartsExtensionInstallRegisters) { registers.registerChartView(PieView); registers.registerSeriesModel(PieSeriesModel); createLegacyDataSelectAction('pie', registers.registerAction); registers.registerLayout(curry(pieLayout, 'pie')); registers.registerProcessor(dataFilter('pie')); }
153808632253/echarts
src/chart/pie/install.ts
TypeScript
ArrowFunction
({ resource }) => ( <ActivityProgress title={`Demo activity for node ${getName(resource)}`
DaoDaoNoCode/console
frontend/packages/console-demo-plugin/src/components/dashboards/activity.tsx
TypeScript
ArrowFunction
() => ( <ActivityItem>Demo
DaoDaoNoCode/console
frontend/packages/console-demo-plugin/src/components/dashboards/activity.tsx
TypeScript
MethodDeclaration
getName(resource)
DaoDaoNoCode/console
frontend/packages/console-demo-plugin/src/components/dashboards/activity.tsx
TypeScript
MethodDeclaration
getNamespace(resource)
DaoDaoNoCode/console
frontend/packages/console-demo-plugin/src/components/dashboards/activity.tsx
TypeScript
ArrowFunction
(props: IIblisReactNativeUndrawProps & SvgProps) => ( <Svg data-name="Layer 1"
vdelacou/-iblis-react-native-undraw
src/components/Festivities.tsx
TypeScript
TypeAliasDeclaration
export type Contact = { id: string; online?: boolean; trueName: string; customName?: string; isUntrustworthy?: boolean; blocked?: boolean; isFriend?: boolean; };
status-im/dappconnect-sdks
packages/react-chat/src/models/Contact.ts
TypeScript
TypeAliasDeclaration
export type Contacts = { [id: string]: Contact; };
status-im/dappconnect-sdks
packages/react-chat/src/models/Contact.ts
TypeScript
FunctionDeclaration
// TODO: Make this return an array of DependencyManagers when we add runtimes with multiple dependency managers export function getDependencyManager(runtime: Runtime): DependencyManager { if (nodeJsRuntimes.has(runtime)) { return 'npm' } else if (pythonRuntimes.has(runtime)) { return 'pip' } else if (dotNetRuntimes.has(runtime)) { return 'cli-package' } throw new Error(`Runtime ${runtime} does not have an associated DependencyManager`) }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
export function getFamily(runtime: string): RuntimeFamily { if (nodeJsRuntimes.has(runtime)) { return RuntimeFamily.NodeJS } else if (pythonRuntimes.has(runtime)) { return RuntimeFamily.Python } else if (dotNetRuntimes.has(runtime)) { return RuntimeFamily.DotNetCore } return RuntimeFamily.Unknown }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
function getSortableCompareText(runtime: Runtime): string { return runtimeCompareText.get(runtime) || runtime.toString() }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
/** * Sorts runtimes from lowest value to greatest value, helpful for outputting alphabetized lists of runtimes * Differs from normal sorting as it numbers into account: e.g. nodeJs8.10 < nodeJs10.x */ export function compareSamLambdaRuntime(a: Runtime, b: Runtime): number { return getSortableCompareText(a).localeCompare(getSortableCompareText(b)) }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
/** * Maps vscode document languageId to `RuntimeFamily`. */ export function getRuntimeFamily(langId: string): RuntimeFamily { switch (langId) { case 'typescript': case 'javascript': return RuntimeFamily.NodeJS case 'csharp': return RuntimeFamily.DotNetCore case 'python': return RuntimeFamily.Python default: return RuntimeFamily.Unknown } }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
/** * Provides the default runtime for a given `RuntimeFamily` or undefined if the runtime is invalid. */ export function getDefaultRuntime(runtime: RuntimeFamily): string | undefined { return DEFAULT_RUNTIMES.get(runtime) }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
/** * Returns a set of runtimes for a specified runtime family or undefined if not found. * @param family Runtime family to get runtimes for */ function getRuntimesForFamily(family: RuntimeFamily): Set<Runtime> | undefined { switch (family) { case RuntimeFamily.NodeJS: return nodeJsRuntimes case RuntimeFamily.Python: return pythonRuntimes case RuntimeFamily.DotNetCore: return dotNetRuntimes default: return undefined } }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
FunctionDeclaration
/** * Creates a quick pick for a Runtime with the following parameters (all optional) * @param {Object} params Optional parameters for creating a QuickPick for runtimes: * @param {vscode.QuickInputButton[]} params.buttons Array of buttons to add to the quick pick; * @param {Runtime} params.currRuntime Runtime to set a "Selected Previously" mark to; * @param {RuntimeFamily} params.runtimeFamily RuntimeFamily that will define the list of runtimes to show (default: samLambdaCreatableRuntimes) */ export function createRuntimeQuickPick(params: { buttons?: vscode.QuickInputButton[] currRuntime?: Runtime runtimeFamily?: RuntimeFamily }): vscode.QuickPick<vscode.QuickPickItem> { const runtimes = params.runtimeFamily ? getRuntimesForFamily(params.runtimeFamily) ?? samLambdaCreatableRuntimes : samLambdaCreatableRuntimes return picker.createQuickPick<vscode.QuickPickItem>({ options: { ignoreFocusOut: true, title: localize('AWS.samcli.initWizard.runtime.prompt', 'Select a SAM Application Runtime'), value: params.currRuntime ? params.currRuntime : '', }, buttons: [...(params.buttons ?? []), vscode.QuickInputButtons.Back], items: runtimes // remove uncreatable runtimes .filter(value => samLambdaCreatableRuntimes.has(value)) .toArray() .sort(compareSamLambdaRuntime) .map(runtime => ({ label: runtime, alwaysShow: runtime === params.currRuntime, description: runtime === params.currRuntime ? localize('AWS.wizard.selectedPreviously', 'Selected Previously') : '', })), }) }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
ArrowFunction
runtime => runtime !== 'nodejs8.10'
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
ArrowFunction
value => samLambdaCreatableRuntimes.has(value)
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
ArrowFunction
runtime => ({ label: runtime, alwaysShow: runtime === params.currRuntime, description: runtime === params.currRuntime ? localize('AWS.wizard.selectedPreviously', 'Selected Previously') : '', })
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
EnumDeclaration
export enum RuntimeFamily { Unknown, Python, NodeJS, DotNetCore, }
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
TypeAliasDeclaration
export type DependencyManager = 'cli-package' | 'mod' | 'gradle' | 'pip' | 'npm' | 'maven' | 'bundler'
feiyao-aws/aws-toolkit-vscode
src/lambda/models/samLambdaRuntime.ts
TypeScript
ClassDeclaration
@NgModule({ declarations: [PanelComponent], imports: [ TooltipModule, CommonModule, DialogsModule ], exports: [PanelComponent] }) export class PanelsModule { }
cheerokee/truckpad
_app/src/app/shared/panels/panels.module.ts
TypeScript
FunctionDeclaration
export function createSubscription<S, T>(config: SubscriptionConfig<S, T>): Subscription<S, T>;
0xProject/DefinitelyTyped
types/create-subscription/index.d.ts
TypeScript
InterfaceDeclaration
export interface SubscriptionConfig<S, T> { /** * Synchronously gets the value for the subscribed property. * Return undefined if the subscribable value is undefined, * Or does not support synchronous reading (e.g. native Promise). */ getCurrentValue: (source: S) => T; /** * Set up a subscription for the subscribable value in props, and return an unsubscribe function. * Return false to indicate the property cannot be unsubscribed from (e.g. native Promises). * Due to the variety of change event types, subscribers should provide their own handlers. * Those handlers should not attempt to update state though; * They should call the callback() instead when a subscription changes. */ subscribe: (source: S, callback: (newValue: T) => void) => Unsubscribe; }
0xProject/DefinitelyTyped
types/create-subscription/index.d.ts
TypeScript
InterfaceDeclaration
export interface SubscriptionProps<S, T> { children: (value: T) => React.ReactNode; source: S; }
0xProject/DefinitelyTyped
types/create-subscription/index.d.ts
TypeScript
InterfaceDeclaration
export interface Subscription<S, T> extends React.ComponentClass<SubscriptionProps<S, T>> {}
0xProject/DefinitelyTyped
types/create-subscription/index.d.ts
TypeScript
TypeAliasDeclaration
export type Unsubscribe = () => any;
0xProject/DefinitelyTyped
types/create-subscription/index.d.ts
TypeScript
FunctionDeclaration
export function main() { return platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); }
strictd/public_website
src/browser/app/main.dev.aot.ts
TypeScript
ClassDeclaration
/** */ export default class Model extends AbstractClass { properties: Array<ClassProperty> = []; config: any = {}; uses: Array<string> = []; constructor(data: any) { super(data); if (data.properties !== undefined) { for (const properId of Object.keys(data.properties)) { if (data.properties[properId] !== undefined) { let p = data.properties[properId]; //process type let type; type = p.type ?? 'string'; type = (type === 'integer') ? 'int' : type; const property = { access: 'private', name: `$${properId}`, type: type, format: p.format ?? 'vachart(50)', description: p.description ?? properId, default: p.default ?? '', example: p.example ?? '', enum: p.enum ?? [], }; this.properties.push(new ClassProperty(property)); } } } } setNamespace(): void { throw new Error('Method not implemented.'); } process(): void { throw new Error('Method not implemented.'); } getJson(): any { return { namespace: this.namespace, isAbstract: false, className: this.name, implenments: this.implenments, properties: this.properties, }; } }
wa-craft/generator
src/generator/wrapper/Model.ts
TypeScript
MethodDeclaration
setNamespace(): void { throw new Error('Method not implemented.'); }
wa-craft/generator
src/generator/wrapper/Model.ts
TypeScript
MethodDeclaration
process(): void { throw new Error('Method not implemented.'); }
wa-craft/generator
src/generator/wrapper/Model.ts
TypeScript
MethodDeclaration
getJson(): any { return { namespace: this.namespace, isAbstract: false, className: this.name, implenments: this.implenments, properties: this.properties, }; }
wa-craft/generator
src/generator/wrapper/Model.ts
TypeScript
ArrowFunction
() => { it('results in an empty object with undefined options', () => { const result = packFilterOptions(undefined); expect(result).toEqual('{}'); }); it('results in an empty object with no options', () => { const result = packFilterOptions({}); expect(result).toEqual('{}'); }); it('encodes threshold to a string', () => { const result = packFilterOptions({ threshold: 5.5, }); expect(result).toEqual('{"threshold":"5.5"}'); }); it('encodes the frequency to a string', () => { const result = packFilterOptions({ alertFrequency: 'ALWAYS', }); expect(result).toEqual('{"alertFrequency":"ALWAYS"}'); }); it('encodes the directMessageType to a string', () => { const result = packFilterOptions({ directMessageType: 'MARKETING', }); expect(result).toEqual('{"directMessageType":"MARKETING"}'); }); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ArrowFunction
() => { const result = packFilterOptions(undefined); expect(result).toEqual('{}'); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ArrowFunction
() => { const result = packFilterOptions({}); expect(result).toEqual('{}'); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ArrowFunction
() => { const result = packFilterOptions({ threshold: 5.5, }); expect(result).toEqual('{"threshold":"5.5"}'); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ArrowFunction
() => { const result = packFilterOptions({ alertFrequency: 'ALWAYS', }); expect(result).toEqual('{"alertFrequency":"ALWAYS"}'); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ArrowFunction
() => { const result = packFilterOptions({ directMessageType: 'MARKETING', }); expect(result).toEqual('{"directMessageType":"MARKETING"}'); }
notifi-network/notifi-sdk-ts
packages/notifi-react-hooks/lib/utils/packFilterOptions.spec.ts
TypeScript
ClassDeclaration
@Component({ tag: 'pr-button', styleUrl: 'pr-button.css', shadow: true, }) export class PrButton { @Prop() color: 'PRIMARY' | 'SECONDARY' = 'PRIMARY'; @Prop() disabled: boolean = false; @Prop() size: 'LARGE' | 'MEDIUM' | 'SMALL' = 'LARGE'; @Prop() text: string; @Prop() icon: string; //Event to emit any action from of parent @Event() event: EventEmitter; eventButton() { this.event.emit(); } //get size of button getSizeOfBotton() { return CONST_SIZES_BUTTON[this.size]; } //get color of button getColorOfButton() { return this.disabled ? CONST_COLORS_BUTTON[this.color]['DISABLED'] : CONST_COLORS_BUTTON[this.color]['ENABLED']; } //get BackgroundColor getBackgroundColor() { return this.disabled ? CONST_COLORS_BUTTON['TRANSPARENT'] : this.getColorOfButton(); } //get object css for button stylePrButton = { ...this.getSizeOfBotton(), backgroundColor: this.getBackgroundColor(), borderColor: this.getColorOfButton(), }; render() { return ( <Host> <button class="pr-button" disabled={this.disabled} style={this.stylePrButton} type="button" onClick={this.eventButton.bind(this)}> {this.text} <img class="imagen" src={this.icon} /> </button> </Host> ); } }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
ClassDeclaration
class
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
MethodDeclaration
eventButton() { this.event.emit(); }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
MethodDeclaration
//get size of button getSizeOfBotton() { return CONST_SIZES_BUTTON[this.size]; }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
MethodDeclaration
//get color of button getColorOfButton() { return this.disabled ? CONST_COLORS_BUTTON[this.color]['DISABLED'] : CONST_COLORS_BUTTON[this.color]['ENABLED']; }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
MethodDeclaration
//get BackgroundColor getBackgroundColor() { return this.disabled ? CONST_COLORS_BUTTON['TRANSPARENT'] : this.getColorOfButton(); }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
MethodDeclaration
render() { return ( <Host> <button class="pr-button" disabled={this.disabled} style={this.stylePrButton} type="button" onClick={this.eventButton.bind(this)}> {this.text} <img class="imagen" src={this.icon} /> </button> </Host> ); }
alvarojbucaro/every-framework-components
src/components/pr-button/pr-button.tsx
TypeScript
ArrowFunction
props => props.disabled && ` background: #000; `
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
(props: HomeProps) => { const [balance, setBalance] = useState<number>(); const [isActive, setIsActive] = useState(isPast(freezerOpenDate)); // true when countdown completes const [isSoldOut, setIsSoldOut] = useState(false); // true when items remaining is zero const [isMinting, setIsMinting] = useState(false); // true when user got to press MINT const [itemsAvailable, setItemsAvailable] = useState(0); const [itemsRedeemed, setItemsRedeemed] = useState(0); const [itemsRemaining, setItemsRemaining] = useState(0); const [alertState, setAlertState] = useState<AlertState>({ open: false, message: "", severity: undefined, }); const [startDate, setStartDate] = useState(new Date(props.startDate)); const wallet = useAnchorWallet(); const [candyMachine, setCandyMachine] = useState<CandyMachine>(); const refreshCandyMachineState = () => { (async () => { if (!wallet) return; const { candyMachine, goLiveDate, itemsAvailable, itemsRemaining, itemsRedeemed, } = await getCandyMachineState( wallet as anchor.Wallet, props.candyMachineId, props.connection ); setItemsAvailable(itemsAvailable); setItemsRemaining(itemsRemaining); setItemsRedeemed(itemsRedeemed); setIsSoldOut(itemsRemaining === 0); setStartDate(goLiveDate); setCandyMachine(candyMachine); })(); }; const onMint = async () => { try { setIsMinting(true); if (wallet && candyMachine?.program) { const mintTxId = await mintOneToken( candyMachine, props.config, wallet.publicKey, props.treasury ); const status = await awaitTransactionSignatureConfirmation( mintTxId, props.txTimeout, props.connection, "singleGossip", false ); if (!status?.err) { setAlertState({ open: true, message: "Congratulations! Mint succeeded!", severity: "success", }); } else { setAlertState({ open: true, message: "Mint failed! Please try again!", severity: "error", }); } } } catch (error: any) { // TODO: blech: let message = error.msg || "Minting failed! Please try again!"; if (!error.msg) { if (error.message.indexOf("0x138")) { } else if (error.message.indexOf("0x137")) { message = `SOLD OUT!`; } else if (error.message.indexOf("0x135")) { message = `Insufficient funds to mint. Please fund your wallet.`; } } else { if (error.code === 311) { message = `SOLD OUT!`; setIsSoldOut(true); } else if (error.code === 312) { message = `Minting period hasn't started yet.`; } } setAlertState({ open: true, message, severity: "error", }); } finally { if (wallet) { const balance = await props.connection.getBalance(wallet.publicKey); setBalance(balance / LAMPORTS_PER_SOL); } setIsMinting(false); refreshCandyMachineState(); } }; useEffect(() => { (async () => { if (wallet) { const balance = await props.connection.getBalance(wallet.publicKey); setBalance(balance / LAMPORTS_PER_SOL); } })(); }, [wallet, props.connection]); useEffect(refreshCandyMachineState, [ wallet, props.candyMachineId, props.connection, ]); useEffect(() => { const intervalId = setInterval(() => { setIsActive(isPast(freezerOpenDate)); }, 1000); return () => clearInterval(intervalId); }, []); return ( <MainContainer> <Header> <p> <a href='/'><ScoopLogoSVG /></a> <img className="wordmark" src={`${process.env.PUBLIC_URL}/img/ScoopShopLogo.svg`}
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => { (async () => { if (!wallet) return; const { candyMachine, goLiveDate, itemsAvailable, itemsRemaining, itemsRedeemed, } = await getCandyMachineState( wallet as anchor.Wallet, props.candyMachineId, props.connection ); setItemsAvailable(itemsAvailable); setItemsRemaining(itemsRemaining); setItemsRedeemed(itemsRedeemed); setIsSoldOut(itemsRemaining === 0); setStartDate(goLiveDate); setCandyMachine(candyMachine); })(); }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
async () => { if (!wallet) return; const { candyMachine, goLiveDate, itemsAvailable, itemsRemaining, itemsRedeemed, } = await getCandyMachineState( wallet as anchor.Wallet, props.candyMachineId, props.connection ); setItemsAvailable(itemsAvailable); setItemsRemaining(itemsRemaining); setItemsRedeemed(itemsRedeemed); setIsSoldOut(itemsRemaining === 0); setStartDate(goLiveDate); setCandyMachine(candyMachine); }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
async () => { try { setIsMinting(true); if (wallet && candyMachine?.program) { const mintTxId = await mintOneToken( candyMachine, props.config, wallet.publicKey, props.treasury ); const status = await awaitTransactionSignatureConfirmation( mintTxId, props.txTimeout, props.connection, "singleGossip", false ); if (!status?.err) { setAlertState({ open: true, message: "Congratulations! Mint succeeded!", severity: "success", }); } else { setAlertState({ open: true, message: "Mint failed! Please try again!", severity: "error", }); } } } catch (error: any) { // TODO: blech: let message = error.msg || "Minting failed! Please try again!"; if (!error.msg) { if (error.message.indexOf("0x138")) { } else if (error.message.indexOf("0x137")) { message = `SOLD OUT!`; } else if (error.message.indexOf("0x135")) { message = `Insufficient funds to mint. Please fund your wallet.`; } } else { if (error.code === 311) { message = `SOLD OUT!`; setIsSoldOut(true); } else if (error.code === 312) { message = `Minting period hasn't started yet.`; } } setAlertState({ open: true, message, severity: "error", }); } finally { if (wallet) { const balance = await props.connection.getBalance(wallet.publicKey); setBalance(balance / LAMPORTS_PER_SOL); } setIsMinting(false); refreshCandyMachineState(); } }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => { (async () => { if (wallet) { const balance = await props.connection.getBalance(wallet.publicKey); setBalance(balance / LAMPORTS_PER_SOL); } })(); }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
async () => { if (wallet) { const balance = await props.connection.getBalance(wallet.publicKey); setBalance(balance / LAMPORTS_PER_SOL); } }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => { const intervalId = setInterval(() => { setIsActive(isPast(freezerOpenDate)); }, 1000); return () => clearInterval(intervalId); }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => { setIsActive(isPast(freezerOpenDate)); }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => clearInterval(intervalId)
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
() => setAlertState({ ...alertState, open: false })
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
({ days, hours, minutes, seconds, completed }: any) => { return ( <CounterText> {hours + (days || 0) * 24}
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
InterfaceDeclaration
export interface HomeProps { candyMachineId: anchor.web3.PublicKey; config: anchor.web3.PublicKey; connection: anchor.web3.Connection; startDate: number; treasury: anchor.web3.PublicKey; txTimeout: number; }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
InterfaceDeclaration
interface AlertState { open: boolean; message: string; severity: "success" | "info" | "warning" | "error" | undefined; }
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
MethodDeclaration
shortenAddress(wallet
penneydude/candy-machine-mint
src/Home.tsx
TypeScript
ArrowFunction
async () => { const trackedUsers = new TrackedUsers(TEST_NETWORK_ID, DB_FACTORY); let err: Error; try { await trackedUsers.setUserTracked("mock"); } catch (e) { err = e; } await expect(err.message).toMatch('invalid address (arg="address", value="mock", version=4.0.24)'); expect(await trackedUsers.getUsers()).toEqual([]); }
MicrohexHQ/augur
packages/augur-sdk/src/state/db/TrackedUsers.test.ts
TypeScript
TypeAliasDeclaration
export type GradientStroke = { /** * Match Name * @desc After Effect's Match Name. Used for expressions */ mn: string; /** * Name * @desc After Effect's Name. Used for expressions */ nm: string; /** * Type * @desc Shape content type */ ty: ShapeType.GradientStroke; /** * Opacity * @desc Stroke Opacity */ o: Value<number | OffsetKeyframe[]>; /** * Start Point * @desc Gradient Start Point */ s: MultiDimensional<number[] | OffsetKeyframe[]>; /** * End Point * @desc Gradient End Point */ e: MultiDimensional<number[] | OffsetKeyframe[]>; /** * Type * @desc Gradient Type */ t: GradientType; /** * Highlight Length * @desc Gradient Highlight Length. Only if type is Radial */ h: Value<number | OffsetKeyframe[]>; /** * Highlight Angle * @desc Highlight Angle. Only if type is Radial */ a: Value<number | OffsetKeyframe[]>; /** * Gradient Colors */ g: GradientColors; /** * Stroke Width * @desc Gradient Stroke Width */ w: Value<number | OffsetKeyframe[]>; /** * Line Cap * @desc Gradient Stroke Line Cap; */ lc: LineCap; /** * Line Join * @desc Gradient Stroke Line Join */ lj: LineJoin; /** * Miter Limit * @desc Gradient Stroke Miter Limit. Only if Line Join is set to Miter */ ml: number; /** * Property Index * @desc Property Index. Used for expressions */ ix?: number; /** * Hide element */ hd?: boolean; /** * 混合樑式 - Blend Mode * @default BlendMode.Normal */ bm?: BlendMode; /** * Dashes */ d?: StorkeDash[]; };
eteplus/lottie-json
types/shapes/gStroke.ts
TypeScript
ClassDeclaration
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. export class WindowUtils { public postMessage(win: Window, data: any, targetOrigin: string): void { win.postMessage(JSON.stringify(data), targetOrigin); } public addEventListener(win: Window, command: string, callback: (e: MessageEvent) => void, useCapture: boolean): void { win.addEventListener(command, callback, useCapture); } public removeEventListener(win: Window, command: string, callback: (e: MessageEvent) => void, useCapture: boolean): void { win.removeEventListener(command, callback); } public setTimeout(handler: Function, timeout: number): number { return window.setTimeout(handler, timeout); } public setInterval(handler: Function, timeout: number): number { return window.setInterval(handler, timeout); } public createObjectURL(sourceObject: Blob | File | MediaSource): string { return window.URL.createObjectURL(sourceObject); } public clearTimeout(timeout: number): void { window.clearTimeout(timeout); } public clearInterval(timeInterval: number): void { window.clearInterval(timeInterval); } public getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration { return window.getComputedStyle(elt, pseudoElt); } public getTopWindow(): Window { return window.top; } public getWindow(): Window { return window; } public isTopWindow(): boolean { return this.getTopWindow() === this.getWindow(); } public getParentWindow(): Window { return window.parent; } public closeWindow(): void { window.close(); } public getPlatform(): string { return window.navigator.platform; } }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public postMessage(win: Window, data: any, targetOrigin: string): void { win.postMessage(JSON.stringify(data), targetOrigin); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public addEventListener(win: Window, command: string, callback: (e: MessageEvent) => void, useCapture: boolean): void { win.addEventListener(command, callback, useCapture); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public removeEventListener(win: Window, command: string, callback: (e: MessageEvent) => void, useCapture: boolean): void { win.removeEventListener(command, callback); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public setTimeout(handler: Function, timeout: number): number { return window.setTimeout(handler, timeout); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public setInterval(handler: Function, timeout: number): number { return window.setInterval(handler, timeout); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public createObjectURL(sourceObject: Blob | File | MediaSource): string { return window.URL.createObjectURL(sourceObject); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public clearTimeout(timeout: number): void { window.clearTimeout(timeout); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public clearInterval(timeInterval: number): void { window.clearInterval(timeInterval); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration { return window.getComputedStyle(elt, pseudoElt); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public getTopWindow(): Window { return window.top; }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public getWindow(): Window { return window; }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public isTopWindow(): boolean { return this.getTopWindow() === this.getWindow(); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public getParentWindow(): Window { return window.parent; }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public closeWindow(): void { window.close(); }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
MethodDeclaration
public getPlatform(): string { return window.navigator.platform; }
AdrianRamiro/accessibility-insights-web
src/common/window-utils.ts
TypeScript
FunctionDeclaration
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://bangular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See bangular/tools/gulp-tasks/cldr/extract.js function plural(n: number): number { return 5; }
johnfedoruk/bangular
packages/common/locales/vi.ts
TypeScript
ClassDeclaration
@Directive({ selector: '[sort-by]', host: { '(click)': 'onClick($event)' } }) export class SortByDirective { private sortProperty: string; @Output() sorted: EventEmitter<string> = new EventEmitter(); constructor() { } @Input('sort-by') set sortBy(value: string) { this.sortProperty = value; } onClick(event: any) { event.preventDefault(); this.sorted.next(this.sortProperty); //Raise clicked event } }
noeliasfranco/angular2POC
src/app/shared/directives/sortby.directive.ts
TypeScript
MethodDeclaration
onClick(event: any) { event.preventDefault(); this.sorted.next(this.sortProperty); //Raise clicked event }
noeliasfranco/angular2POC
src/app/shared/directives/sortby.directive.ts
TypeScript
InterfaceDeclaration
export interface ScreenProps extends ViewProps { active?: 0 | 1 | Animated.AnimatedInterpolation; activityState?: 0 | 1 | 2 | Animated.AnimatedInterpolation; children?: React.ReactNode; /** * All children screens should have the same value of their "enabled" prop as their container. */ enabled?: boolean; /** * Whether you can use gestures to dismiss this screen. Defaults to `true`. * Only supported on iOS. * * @platform ios */ gestureEnabled?: boolean; /** * A callback that gets called when the current screen appears. */ onAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void; onComponentRef?: (view: unknown) => void; /** * A callback that gets called when the current screen disappears. */ onDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void; /** * A callback that gets called when the current screen is dismissed by hardware back (on Android) or dismiss gesture (swipe back or down). * The callback takes the number of dismissed screens as an argument since iOS 14 native header back button can pop more than 1 screen at a time. */ onDismissed?: (e: NativeSyntheticEvent<{ dismissCount: number }>) => void; /** * A callback that gets called when the current screen will appear. This is called as soon as the transition begins. */ onWillAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void; /** * A callback that gets called when the current screen will disappear. This is called as soon as the transition begins. */ onWillDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void; ref?: React.Ref<View>; /** * How should the screen replacing another screen animate. Defaults to `pop`. * The following values are currently supported: * - "push" – the new screen will perform push animation. * - "pop" – the new screen will perform pop animation. */ replaceAnimation?: ScreenReplaceTypes; /** * In which orientation should the screen appear. * The following values are currently supported: * - "default" - resolves to "all" without "portrait_down" on iOS. On Android, this lets the system decide the best orientation. * - "all" – all orientations are permitted * - "portrait" – portrait orientations are permitted * - "portrait_up" – right-side portrait orientation is permitted * - "portrait_down" – upside-down portrait orientation is permitted * - "landscape" – landscape orientations are permitted * - "landscape_left" – landscape-left orientation is permitted * - "landscape_right" – landscape-right orientation is permitted */ screenOrientation?: ScreenOrientationTypes; /** * How the screen should appear/disappear when pushed or popped at the top of the stack. * The following values are currently supported: * - "default" – uses a platform default animation * - "fade" – fades screen in or out * - "flip" – flips the screen, requires stackPresentation: "modal" (iOS only) * - "simple_push" – performs a default animation, but without shadow and native header transition (iOS only) * - `slide_from_bottom` – performs a slide from bottom animation (iOS only) * - "slide_from_right" - slide in the new screen from right to left (Android only, resolves to default transition on iOS) * - "slide_from_left" - slide in the new screen from left to right (Android only, resolves to default transition on iOS) * - "none" – the screen appears/dissapears without an animation */ stackAnimation?: StackAnimationTypes; /** * How should the screen be presented. * The following values are currently supported: * - "push" – the new screen will be pushed onto a stack which on iOS means that the default animation will be slide from the side, the animation on Android may vary depending on the OS version and theme. * - "modal" – the new screen will be presented modally. In addition this allow for a nested stack to be rendered inside such screens. * - "transparentModal" – the new screen will be presented modally but in addition the second to last screen will remain attached to the stack container such that if the top screen is non opaque the content below can still be seen. If "modal" is used instead the below screen will get unmounted as soon as the transition ends. * - "containedModal" – will use "UIModalPresentationCurrentContext" modal style on iOS and will fallback to "modal" on Android. * - "containedTransparentModal" – will use "UIModalPresentationOverCurrentContext" modal style on iOS and will fallback to "transparentModal" on Android. * - "fullScreenModal" – will use "UIModalPresentationFullScreen" modal style on iOS and will fallback to "modal" on Android. * - "formSheet" – will use "UIModalPresentationFormSheet" modal style on iOS and will fallback to "modal" on Android. */ stackPresentation?: StackPresentationTypes; /** * Sets the status bar animation (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. */ statusBarAnimation?: 'none' | 'fade' | 'slide'; /** * Sets the status bar color (similar to the `StatusBar` component). Defaults to initial status bar color. * * @platform android */ statusBarColor?: string; /** * Whether the status bar should be hidden on this screen. Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `false`. */ statusBarHidden?: boolean; /** * Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `auto`. */ statusBarStyle?: 'inverted' | 'auto' | 'light' | 'dark'; /** * Sets the translucency of the status bar. Defaults to `false`. * * @platform android */ statusBarTranslucent?: boolean; }
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
InterfaceDeclaration
export interface ScreenContainerProps extends ViewProps { children?: React.ReactNode; /** * A prop that gives users an option to switch between using Screens for the navigator (container). All children screens should have the same value of their "enabled" prop as their container. */ enabled?: boolean; }
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
InterfaceDeclaration
export interface ScreenStackProps extends ViewProps { children?: React.ReactNode; /** * A callback that gets called when the current screen finishes its transition. */ onFinishTransitioning?: (e: NativeSyntheticEvent<TargetedEvent>) => void; }
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
InterfaceDeclaration
export interface ScreenStackHeaderConfigProps extends ViewProps { /** * Whether to show the back button with custom left side of the header. */ backButtonInCustomView?: boolean; /** * Controls the color of the navigation header. */ backgroundColor?: string; /** * Title to display in the back button. * @platform ios. */ backTitle?: string; /** * Allows for customizing font family to be used for back button title on iOS. * @platform ios */ backTitleFontFamily?: string; /** * Allows for customizing font size to be used for back button title on iOS. * @platform ios */ backTitleFontSize?: number; /** * Blur effect to be applied to the header. Works with backgroundColor's alpha < 1. * @platform ios */ blurEffect?: BlurEffectTypes; /** * Pass HeaderLeft, HeaderRight and HeaderTitle */ children?: React.ReactNode; /** * Controls the color of items rendered on the header. This includes back icon, back text (iOS only) and title text. If you want the title to have different color use titleColor property. */ color?: string; /** * Whether the stack should be in rtl or ltr form. */ direction?: 'rtl' | 'ltr'; /** * Boolean indicating whether to show the menu on longPress of iOS >= 14 back button. * @platform ios */ disableBackButtonMenu?: boolean; /** * When set to true the header will be hidden while the parent Screen is on the top of the stack. The default value is false. */ hidden?: boolean; /** * Boolean indicating whether to hide the back button in header. */ hideBackButton?: boolean; /** * Boolean indicating whether to hide the elevation shadow or the bottom border on the header. */ hideShadow?: boolean; /** * Boolean to set native property to prefer large title header (like in iOS setting). * For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`. * If the scrollable area doesn't fill the screen, the large title won't collapse on scroll. * Only supported on iOS. * * @platform ios */ largeTitle?: boolean; /** * Controls the color of the navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar. */ largeTitleBackgroundColor?: string; /** * Customize the color to be used for the large title. By default uses the titleColor property. * @platform ios */ largeTitleColor?: string; /** * Customize font family to be used for the large title. * @platform ios */ largeTitleFontFamily?: string; /** * Customize the size of the font to be used for the large title. * @platform ios */ largeTitleFontSize?: number; /** * Customize the weight of the font to be used for the large title. * @platform ios */ largeTitleFontWeight?: string; /** * Boolean that allows for disabling drop shadow under navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar. */ largeTitleHideShadow?: boolean; /** * String that can be displayed in the header as a fallback for `headerTitle`. */ title?: string; /** * Allows for setting text color of the title. */ titleColor?: string; /** * Customize font family to be used for the title. */ titleFontFamily?: string; /** * Customize the size of the font to be used for the title. */ titleFontSize?: number; /** * Customize the weight of the font to be used for the title. */ titleFontWeight?: string; /** * A flag to that lets you opt out of insetting the header. You may want to * set this to `false` if you use an opaque status bar. Defaults to `true`. * Only supported on Android. Insets are always applied on iOS because the * header cannot be opaque. * * @platform android */ topInsetEnabled?: boolean; /** * Boolean indicating whether the navigation bar is translucent. */ translucent?: boolean; }
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
InterfaceDeclaration
export interface SearchBarProps { /** * Indicates whether to to obscure the underlying content */ obscureBackground?: boolean; /** * Indicates whether to hide the navigation bar */ hideNavigationBar?: boolean; /** * Indicates whether to hide the search bar when scrolling */ hideWhenScrolling?: boolean; /** * The auto-capitalization behavior */ autoCapitalize?: 'none' | 'words' | 'sentences' | 'characters'; /** * Text displayed when search field is empty */ placeholder?: string; /** * The search field background color */ barTintColor?: string; /** * A callback that gets called when the text changes. It receives the current text value of the search bar. */ onChangeText?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void; /** * A callback that gets called when the cancel button is pressed */ onCancelButtonPress?: (e: NativeSyntheticEvent<TargetedEvent>) => void; /** * A callback that gets called when the search button is pressed. It receives the current text value of the search bar. */ onSearchButtonPress?: ( e: NativeSyntheticEvent<TextInputFocusEventData> ) => void; /** * A callback that gets called when search bar has received focus */ onFocus?: (e: NativeSyntheticEvent<TargetedEvent>) => void; /** * A callback that gets called when search bar has lost focus */ onBlur?: (e: NativeSyntheticEvent<TargetedEvent>) => void; }
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type StackPresentationTypes = | 'push' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal' | 'fullScreenModal' | 'formSheet';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type StackAnimationTypes = | 'default' | 'fade' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type BlurEffectTypes = | 'extraLight' | 'light' | 'dark' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type ScreenReplaceTypes = 'push' | 'pop';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type ScreenOrientationTypes = | 'default' | 'all' | 'portrait' | 'portrait_up' | 'portrait_down' | 'landscape' | 'landscape_left' | 'landscape_right';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
TypeAliasDeclaration
export type HeaderSubviewTypes = | 'back' | 'right' | 'left' | 'center' | 'searchBar';
flavien-ro/React-Native-Task-Manager
task-manager/client/node_modules/react-native-screens/src/types.tsx
TypeScript
ArrowFunction
()=> { let context:JcadContext = null; let getContextSpy:any = null; let getDecoratorSpy:any = null; let annotationSpy:any = null; let decorateSpy:any = null; before(()=> { getContextSpy = sinon.spy(JcadContextManager.getInstance(), "getContext"); getDecoratorSpy = sinon.spy(DecoratorConnectorManager.getInstance(), "getDecorator"); annotationSpy = sinon.spy(DELETEAnnotation, "DELETE"); decorateSpy = sinon.spy(utils.TEST_DECORATOR, "decorate"); context = utils.initContext(); utils.buildClassRef(); }); after(()=> { utils.resetContext(context); sinon.restore(); }); beforeEach(()=> { utils.buildClassRef(); }); describe("@DELETE", ()=> { it("should invoke the JcadContextManager with the JarsConnectorRefs.DELETE_CONNECTOR_REF reference", function() { sinon.assert.calledOnce(getContextSpy); sinon.assert.calledWith( getContextSpy, JarsConnectorRefs.DELETE_CONNECTOR_REF ); }); it("should invoke the DecoratorConnectorManager with the JarsConnectorRefs.DELETE_CONNECTOR_REF reference and the correct JCAD context", function() { sinon.assert.calledOnce(getDecoratorSpy); sinon.assert.calledWith( getDecoratorSpy, JarsConnectorRefs.DELETE_CONNECTOR_REF, context ); }); it("should invoke the annotation decorator with the right parameters", function() { sinon.assert.calledOnce(annotationSpy); //sinon.assert.calledWith(getDecoratorSpy, params.HTTP_METHOD_PARAMS); }); it("should invoke the registered decorator with the right method name and parameters", function() { sinon.assert.calledOnce(decorateSpy); //sinon.assert.calledWith(getDecoratorSpy, params.HTTP_METHOD_PARAMS); }); }); }
jec-project/jec-jars
test/com/jec/jars/annotations/DELETETest.ts
TypeScript
ArrowFunction
()=> { getContextSpy = sinon.spy(JcadContextManager.getInstance(), "getContext"); getDecoratorSpy = sinon.spy(DecoratorConnectorManager.getInstance(), "getDecorator"); annotationSpy = sinon.spy(DELETEAnnotation, "DELETE"); decorateSpy = sinon.spy(utils.TEST_DECORATOR, "decorate"); context = utils.initContext(); utils.buildClassRef(); }
jec-project/jec-jars
test/com/jec/jars/annotations/DELETETest.ts
TypeScript
ArrowFunction
()=> { utils.resetContext(context); sinon.restore(); }
jec-project/jec-jars
test/com/jec/jars/annotations/DELETETest.ts
TypeScript
ArrowFunction
()=> { utils.buildClassRef(); }
jec-project/jec-jars
test/com/jec/jars/annotations/DELETETest.ts
TypeScript