type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
async(context: AppContext) => { const { logger } = context; cron.schedule('00 36 */1 * * *', async () => { logger.setTraceId(uuidv4()); logger.info('job executed'); const start = +new Date(); const transaction = Sentry.startTransaction({ op: "maintenance", ...
chemistry/crystallography-online
packages/containers/maintenance/src/app.ts
TypeScript
ArrowFunction
async () => { logger.setTraceId(uuidv4()); logger.info('job executed'); const start = +new Date(); const transaction = Sentry.startTransaction({ op: "maintenance", name: "Process Messages", }); await processMessage({ context }); transac...
chemistry/crystallography-online
packages/containers/maintenance/src/app.ts
TypeScript
InterfaceDeclaration
export interface AppContext { logger: { trace:(message: string) => Promise<void>; info: (message: string) => Promise<void>; error: (message: string) => Promise<void>; setTraceId: (id: string) => void; }, db: Db; close: ()=> Promise<void>; }
chemistry/crystallography-online
packages/containers/maintenance/src/app.ts
TypeScript
ArrowFunction
(p,i)=>result[p]=path[i]||'_'
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
ArrowFunction
n=>parameters[n]||'_'
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
ClassDeclaration
@Injectable() export class MapViewParameterService { constructor(private _location?: Location) { } static parameterNames:Array<string> = []; current():any{ if(!this._location){ return {}; } let path = this._location.path().split('/'); if(path.length>MapViewParameterService.parameterNa...
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
MethodDeclaration
current():any{ if(!this._location){ return {}; } let path = this._location.path().split('/'); if(path.length>MapViewParameterService.parameterNames.length){ path.shift(); } let result:any = {}; MapViewParameterService.parameterNames.forEach((p,i)=>result[p]=path[i]||'_'); r...
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
MethodDeclaration
update(changes:any){ if(!this._location){ return; } let updated = this.current(); Object.assign(updated,changes); this._location.go(this.constructRoute(updated)); }
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
MethodDeclaration
retrieveFromRoute(route:any){ let result:any = {}; for(let name of MapViewParameterService.parameterNames){ result[name] = route.snapshot.params[name]; } return result; }
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
MethodDeclaration
constructRoute(parameters:any){ return MapViewParameterService.parameterNames.map(n=>parameters[n]||'_').join('/'); }
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
MethodDeclaration
routerPaths(/*component:any*/):Array<any>{ let result:Array<any> = []; let path = ''; result.push(path); // result.push({path:path,component:component}); for(let name of MapViewParameterService.parameterNames){ path += `:${name}`; // result.unshift({path:path,component:component}); ...
ANU-WALD/map-wald
src/map-view.service.ts
TypeScript
FunctionDeclaration
export async function connect () : Promise<Pool> { if (globalPool){ return globalPool } globalPool = await createPool({ host: process.env.MYSQL_HOST, user: process.env.MYSQL_USER, password: process.env.MYSQL_PASSWORD, database: process.env.MYSQL_DATABASE, connectionLimit: 10, namedPla...
Brody-code-designer/example-capstone
backend/src/utils/database.utils.ts
TypeScript
InterfaceDeclaration
// Original file: proto/session.proto export interface GetKeyValueRequest { key?: string; }
furinkapp/proto-node
src/furink/session/GetKeyValueRequest.ts
TypeScript
InterfaceDeclaration
export interface GetKeyValueRequest__Output { key: string; }
furinkapp/proto-node
src/furink/session/GetKeyValueRequest.ts
TypeScript
FunctionDeclaration
function summary(dat: Profile[]): Summary { const res = new Summary(); // Fold over dat to produce the summary for (const e of dat) { var isLast = e.built === 0; res.sumExecution += e.execution; var traces = e.traces; if (!traces) continue; for (const t of traces) {...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
// Mutate the input data, adding in rdeps, being the 1-level reverse dependencies function addRdeps(dat: Profile[]): (Profile & { rdeps: int[] })[] { // find the reverse dependencies var rdeps: MapInt<void>[] = []; for (let i = 0; i < dat.length; i++) rdeps[i] = {}; for (let i = 0; i < dat.lengt...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
// Given an array of indices, calculate the cost to rebuild if all of them change // You must call addRdeps and addCost first function calcRebuildCosts(dat: ProfileEx[], xs : int[]) : seconds { const seen: MapInt<void> = {}; let tot : seconds = 0; function f(i : int) { if (i in seen) return; ...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function f(i : int) { if (i in seen) return; seen[i] = null; tot += dat[i].execution; for (const j of dat[i].rdeps) f(j); }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
// Mutate the dat data, adding in cost, being the cost to rebuild if this item changes function addCost(dat: (Profile & { rdeps: int[] })[]): ProfileEx[] { const res: (Profile & { rdeps: int[], cost?: seconds })[] = dat; for(let i = 0; i < dat.length; i++){ // This call is type safe because calcRebuildC...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function prepare(dat_: Profile[]): Prepare { const sum = summary(dat_); const dat = addCost(addRdeps(dat_)); function toHash(r: RegExp | string): string { return typeof r === "string" ? "$" + r : "/" + r.source; } function findDirect(key: string): (from: int, match: string | RegExp) => bo...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function toHash(r: RegExp | string): string { return typeof r === "string" ? "$" + r : "/" + r.source; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function findDirect(key: string): (from: int, match: string | RegExp) => boolean { const c = cache(toHash, function (r) { const want: MapInt<void> = {}; for (const e of dat) { if (testRegExp(r, e.name)) { const deps : int[] = (<any>(e))[key]; ...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function findTransitive(key: string, dirFwd: boolean): (from: int, match: string | RegExp) => boolean { var c = cache(toHash, function (r) { var want: MapInt<void> = {}; for (var i = 0; i < dat.length; i++) { var j = dirFwd ? i : dat.length - 1 - i; if ((...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
///////////////////////////////////////////////////////////////////// // RULES function colorAnd(c1: color, c2: color) { return c1 === null ? c2 : c1 === c2 ? c1 : undefined; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function ruleTable(dat: Prepare, query: string): ResultTable[] { function bools(x : string | boolean, y : boolean) : string | boolean { return x === "" ? y : x === y ? x : "both"; } var res = ruleFilter(dat, query); var ans : ResultTable[] = []; for (var s in res) { var xs = res[s]...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function bools(x : string | boolean, y : boolean) : string | boolean { return x === "" ? y : x === y ? x : "both"; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function ruleGraph(dat : Prepare, query : string) : ResultGraph[] { var res = ruleFilter(dat, query); var map : MapInt<int[]> = {}; // which nodes a node lives at // loop through each value in res, putting it into map (these are parents) // for any not present, descend through the dat.original list, ...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function getDirect(key : int) : int[] { return key in direct ? [direct[key]] : []; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function getIndirect(key : int) : int[] { if (key in indirect) return indirect[key]; if (key in direct) return []; var ds = dat.original[key].depends; const res: int[][] = []; for (var j = 0; j < ds.length; j++) { res.push(getIndirect(ds[j])); res.push(ge...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
///////////////////////////////////////////////////////////////////// // COMMANDS function commandFilter(last: boolean, dat: Prepare, query: string): MapString<{ items: Trace[], text: color, back: color }> { queryData = dat; var f = readQuery(query); var res: MapString<{ items: Trace[], text: color, back: c...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function commandTable(dat: Prepare, query : string) : CommandTable[] { var res = commandFilter(false, dat, query); var ans : CommandTable[] = []; for (var s in res) { var xs = res[s].items; var time = 0; for (const t of xs) time += t.stop - t.start; ans.push({ na...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
function commandPlot(dat: Prepare, query: string, buckets: int): MapString<{ items: number[], back: color }> { var end = dat.summary.maxTraceStopLast; var res = commandFilter(true, dat, query); var ans: MapString<{ items: number[], back: color }> = {}; for (var s in res) { var ts = res[s].items...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ArrowFunction
(i, r) => i in c(r)
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
////////////////////////////////////////////////////////////////////// // SUMMARY class Summary { sumExecution: seconds = 0 // build time in total countTraceLast : int = 0 // traced commands run maxTraceStopLast: seconds = 0 // time the last traced command stopped }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
class Prepare { original: ProfileEx[]; summary: Summary; dependsOnThis: (from: int, match: string | RegExp) => boolean; thisDependsOn: (from: int, match: string | RegExp) => boolean; dependsOnThisTransitive: (from: int, match: string | RegExp) => boolean; thisDependsOnTransitive: (from: int, ma...
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
class Result { items: int[]; text: color; back: color; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
class ResultTable { name: string; count: int; time: seconds; back: color; text: color; cost: seconds; leaf: string | boolean; // true, false, "" (none), "both" (both) run: timestamp; unchanged: string | boolean; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
class ResultGraph { name: string; text: color; back: color; parents: int[]; ancestors: int[]; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
ClassDeclaration
class CommandTable { name: string; count: int; text: color; back: color; time: seconds; }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
InterfaceDeclaration
///////////////////////////////////////////////////////////////////// // PREPARATION interface ProfileEx extends Profile { rdeps: int[]; // the 1-level reverse dependencies, index into Entry cost: seconds; // cost if this item rebuilds }
DavidEichmann/shake
html/ts/shake-logic.ts
TypeScript
FunctionDeclaration
//asynchronous waiting async function bootstrap() { //Usando o pattern Factory para criar o módulo raiz. const app = await NestFactory.create(AppModule); app.useGlobalPipes(new ValidationPipe()); await app.listen(3000); }
berj01/places-api
src/main.ts
TypeScript
ArrowFunction
(executionResult: string | undefined): void => { this.executionResultText = executionResult; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ArrowFunction
(queryState: ServicePureExecutionQueryState): void => { this.queryState = queryState; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ArrowFunction
(runtime) => runtime.runtimeValue.mappings.map((m) => m.value).includes(mapping)
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ArrowFunction
(m) => m.value
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ClassDeclaration
export abstract class ServiceExecutionState { editorStore: EditorStore; serviceEditorState: ServiceEditorState; execution: ServiceExecution; selectedSingeExecutionTestState?: SingleExecutionTestState | undefined; selectedTab = SERVICE_EXECUTION_TAB.MAPPING_AND_RUNTIME; constructor( editorStore: Editor...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ClassDeclaration
export class ServicePureExecutionQueryState extends LambdaEditorState { editorStore: EditorStore; execution: PureExecution; isInitializingLambda = false; openQueryImporter = false; queries: LightQuery[] = []; selectedQueryInfo?: QueryImportInfo | undefined; loadQueriesState = ActionState.create(); loa...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ClassDeclaration
export class ServicePureExecutionState extends ServiceExecutionState { queryState: ServicePureExecutionQueryState; declare execution: PureExecution; selectedExecutionConfiguration?: | PureSingleExecution | KeyedExecutionParameter | undefined; runtimeEditorState?: RuntimeEditorState | undefined; i...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
InterfaceDeclaration
interface QueryImportInfo { query: LightQuery; content: string; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
EnumDeclaration
export enum SERVICE_EXECUTION_TAB { MAPPING_AND_RUNTIME = 'MAPPING_&_Runtime', TESTS = 'TESTS', }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
setSelectedTab(val: SERVICE_EXECUTION_TAB): void { this.selectedTab = val; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
getInitiallySelectedTestState( execution: ServiceExecution, test: ServiceTest, ): SingleExecutionTestState | undefined { if (execution instanceof PureSingleExecution) { return new SingleExecutionTestState( this.editorStore, this.serviceEditorState, ); } else if (execution ...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
setIsInitializingLambda(val: boolean): void { this.isInitializingLambda = val; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
setLambda(val: RawLambda): void { this.execution.setFunction(val); }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
setOpenQueryImporter(val: boolean): void { this.openQueryImporter = val; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*setSelectedQueryInfo(query: LightQuery | undefined): GeneratorFn<void> { if (query) { try { this.loadQueryInfoState.inProgress(); const content = (yield this.editorStore.graphManagerState.graphManager.lambdaToPureCode( (yield this.editorStore.graphManagerState.graphMana...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*importQuery(): GeneratorFn<void> { if (this.selectedQueryInfo) { try { this.importQueryState.inProgress(); const lambda = (yield this.editorStore.graphManagerState.graphManager.pureCodeToLambda( this.selectedQueryInfo.content, )) as RawLambda; yield fl...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*loadQueries(searchText: string): GeneratorFn<void> { const isValidSearchString = searchText.length >= 3; this.loadQueriesState.inProgress(); const dependencyProjectCoordinates = Array.from( ( (yield flowResult( this.editorStore.graphState.getConfigurationProjectDependencyEntities()...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*updateLamba(val: RawLambda): GeneratorFn<void> { this.setLambda(val); yield flowResult(this.convertLambdaObjectToGrammarString(true)); }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*convertLambdaObjectToGrammarString(pretty?: boolean): GeneratorFn<void> { if (this.execution.func.body) { try { const lambdas = new Map<string, RawLambda>(); lambdas.set( this.lambdaId, new RawLambda( this.execution.func.parameters, this.execution....
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
// NOTE: since we don't allow edition in text mode, we don't need to implement this *convertLambdaGrammarStringToObject(): GeneratorFn<void> { throw new UnsupportedOperationError(); }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
setOpeningQueryEditor(val: boolean): void { this.isOpeningQueryEditor = val; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*generatePlan(): GeneratorFn<void> { if (!this.selectedExecutionConfiguration || this.isGeneratingPlan) { return; } try { this.isGeneratingPlan = true; const query = this.queryState.query; yield flowResult( this.executionPlanState.generatePlan( this.selectedExecuti...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
*execute(): GeneratorFn<void> { if (!this.selectedExecutionConfiguration || this.isExecuting) { return; } try { this.isExecuting = true; const query = this.queryState.query; const result = (yield this.editorStore.graphManagerState.graphManager.executeMapping( this....
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
closeRuntimeEditor(): void { this.runtimeEditorState = undefined; }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
openRuntimeEditor(): void { if ( this.selectedExecutionConfiguration && !(this.selectedExecutionConfiguration.runtime instanceof RuntimePointer) ) { this.runtimeEditorState = new RuntimeEditorState( this.editorStore, this.selectedExecutionConfiguration.runtime, true, ...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
useCustomRuntime(): void { if (this.selectedExecutionConfiguration) { const customRuntime = new EngineRuntime(); customRuntime.addMapping( PackageableElementExplicitReference.create( this.selectedExecutionConfiguration.mapping.value, ), ); decorateRuntimeWithNewMap...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
autoSelectRuntimeOnMappingChange(mapping: Mapping): void { if (this.selectedExecutionConfiguration) { const runtimes = this.editorStore.graphManagerState.graph.ownRuntimes.filter((runtime) => runtime.runtimeValue.mappings.map((m) => m.value).includes(mapping), ); if (runtimes....
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
getInitiallySelectedExecution( execution: PureExecution, ): PureSingleExecution | KeyedExecutionParameter | undefined { if (execution instanceof PureSingleExecution) { return execution; } else if (execution instanceof PureMultiExecution) { if (execution.executionParameters.length) { r...
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
MethodDeclaration
updateExecutionQuery(): void { this.execution.setFunction(this.queryState.query); }
hardikmaheshwari/legend-studio
packages/legend-studio/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts
TypeScript
ClassDeclaration
export class UIAutomator extends LocatorStrategy { pick(value: string): LocatorStrategy { const uiSelector: string = this.selector.selector.split('=')[1]; const selector: string = `android=new UiScrollable(${uiSelector}).flingToBeginning(100).scrollIntoView(new UiSelector().textContains(\"${value}\"))`; ...
modanisa/moilate
src/locator-strategies/UIAutomatorLocator.ts
TypeScript
MethodDeclaration
pick(value: string): LocatorStrategy { const uiSelector: string = this.selector.selector.split('=')[1]; const selector: string = `android=new UiScrollable(${uiSelector}).flingToBeginning(100).scrollIntoView(new UiSelector().textContains(\"${value}\"))`; $(selector).click(); return this; }
modanisa/moilate
src/locator-strategies/UIAutomatorLocator.ts
TypeScript
MethodDeclaration
slowPick(value: string): LocatorStrategy { const uiSelector: string = this.selector.selector.split('=')[1]; const selector: string = `android=new UiScrollable(${uiSelector}).scrollIntoView(new UiSelector().textContains(\"${value}\"))`; $(selector).click(); return this; }
modanisa/moilate
src/locator-strategies/UIAutomatorLocator.ts
TypeScript
MethodDeclaration
select(): Selector { this.selector = new UIAutomatorSelector(this); return this.selector; }
modanisa/moilate
src/locator-strategies/UIAutomatorLocator.ts
TypeScript
FunctionDeclaration
function ToastIcon() { const isLaoding = type === 'loading'; const fill = isLaoding ? '#0278FF' : '#ffffff'; if (hasIcon) { return ( <i class={[bem('icon'), { [`${brandName}loading-circle`]: isLaoding }]} style={{ fill, width: '1.5rem', height: '1.5rem' }} ...
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
ArrowFunction
value => { return types.indexOf(value) > -1; }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
InterfaceDeclaration
export interface ToastProps { icon: string; message: number | string; forbidClick: boolean; type: ToastTypes; position: string; lockScroll: boolean; }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
InterfaceDeclaration
export interface ToastEvents { onOpened(): void; onClosed(): void; }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
InterfaceDeclaration
export interface ToastScopedSlots extends DefaultSlots {}
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
TypeAliasDeclaration
type ToastTypes = 'text' | 'success' | 'warning' | 'error' | 'loading';
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
data() { return { clickable: false, }; }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
mounted() { this.toggleClickable(); }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
destroyed() { this.toggleClickable(); }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
value() { this.toggleClickable(); }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
forbidClick() { this.toggleClickable(); }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
toggleClickable(this: any) { const brandName = createBrandName(); const clickable = this.value && this.forbidClick; if (this.clickable !== clickable) { this.clickable = clickable; const action = clickable ? 'add' : 'remove'; document.body.classList[action](`${brandName}toast-...
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
onAfterEnter(this: any) { this.$emit('opened'); if (this.onOpened) { this.onOpened(); } }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
onAfterLeave(this: any) { this.$emit('closed'); }
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
render(this: any) { const brandName = createBrandName(); const { type, icon, message } = this; const hasIcon = icon || (types.indexOf(type) > -1 && type !== 'text'); function ToastIcon() { const isLaoding = type === 'loading'; const fill = isLaoding ? '#0278FF' : '#ffffff'; if (has...
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
MethodDeclaration
require(`!html-loader!./icon/${type
Tao-Mao/okeedesign-mobile-vue
src/components/toast/Toast.tsx
TypeScript
ClassDeclaration
export class Table extends MenuItem { constructor(vditor: IVditor, menuItem: IMenuItem) { super(vditor, menuItem); this.element.children[0].innerHTML = menuItem.icon || tableSVG; this.bindEvent(); } public bindEvent() { super.bindEvent(); } }
MonkSoul/vditor
src/ts/toolbar/Table.ts
TypeScript
MethodDeclaration
public bindEvent() { super.bindEvent(); }
MonkSoul/vditor
src/ts/toolbar/Table.ts
TypeScript
ArrowFunction
value => !!value && value.length >= minLength
3beca/cep-ui
src/components/search-bar/index.tsx
TypeScript
ArrowFunction
(ev: React.ChangeEvent<HTMLInputElement>) => setSearchText(ev.target.value)
3beca/cep-ui
src/components/search-bar/index.tsx
TypeScript
TypeAliasDeclaration
export type SearchBarProps = { hint?: string; delay?: number; minLength?: number; onSearchFor?(searchText: string): void; };
3beca/cep-ui
src/components/search-bar/index.tsx
TypeScript
FunctionDeclaration
export default function Intro() { const session = useContext(SessionContext); return ( <div className='h-screen px-4 pt-40'> <div className='mx-auto max-w-7xl px-3 md:px-10'> <div className='text-center'> <p className='mt-2 text-3xl font-medium leading-8 sm:text-5xl'> Say 👋 to <span classN...
lucky-chap/xema
src/components/Intro.tsx
TypeScript
ArrowFunction
feature => ( <div key={feature.name}
lucky-chap/xema
src/components/Intro.tsx
TypeScript
FunctionDeclaration
export default function Index() { return ( <Container> <div className="mt-16 mx-auto mb-16 max-w-3xl flex flex-col justify-center items-center"> <h1 className="font-logo text-4xl 2xs:text-[2.8rem] sm:text-6xl xl:text-8xl"> <ExternalLink href="https://shivamra...
Shivam010/Shivam010
pages/index.tsx
TypeScript
FunctionDeclaration
function externalLinkWrapper(href: string, child: string) { return ( <ExternalLink href={href}> <span className="relative -bottom-[1px] font-bold text-pink-700 italic hover:underline underline-offset-4"> {child} </span> </ExternalLink> ); }
Shivam010/Shivam010
pages/index.tsx
TypeScript
ArrowFunction
x => [...x.values()]
Azure/BatchExplorer
src/@batch-flask/ui/sidebar/sidebar-manager.ts
TypeScript