type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
t('olm~Create a {{initializationResourceKind}} instance to use this Operator.', { initializationResourceKind, })
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Operator failed')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
referenceForModel(ClusterServiceVersionModel)
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
operatorNamespaceFor(props
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Provider')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Support')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Get support')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Created at')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
isCatalogSourceTrusted(subscription?.spec?.source)
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Links')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Not available')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Maintainers')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Operands in this Namespace are managed by the Operator.')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Status')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Status reason')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Unknown')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Operator Deployments')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~Operator ServiceAccounts')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~OperatorGroup')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
operatorGroupFor(props
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
referenceForModel(OperatorGroupModel)
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~No Operator Subscription')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
MethodDeclaration
t('olm~This Operator will not receive updates.')
VeereshAradhya/console
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
TypeScript
ArrowFunction
() => { beforeEach(() => { TestBed.configureTestingModule({ providers: [PostsService] }); }); it('should ...', inject([PostsService], (service: PostsService) => { expect(service).toBeTruthy(); })); }
Bhaskers-Blu-Org1/Using-Blockchain-to-Track-fitness-Rewards
fitcoin-app/src/app/posts.service.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ providers: [PostsService] }); }
Bhaskers-Blu-Org1/Using-Blockchain-to-Track-fitness-Rewards
fitcoin-app/src/app/posts.service.spec.ts
TypeScript
ArrowFunction
(service: PostsService) => { expect(service).toBeTruthy(); }
Bhaskers-Blu-Org1/Using-Blockchain-to-Track-fitness-Rewards
fitcoin-app/src/app/posts.service.spec.ts
TypeScript
FunctionDeclaration
/** * @private */ function loadVectorTile(params: WorkerTileParameters, callback: LoadVectorDataCallback) { const request = getArrayBuffer(params.request, (err?: Error | null, data?: ArrayBuffer | null, cacheControl?: string | null, expires?: string | null) => { if (err) { callback(err); } else if (data) { callback(null, { vectorTile: new vt.VectorTile(new Protobuf(data)), rawData: data, cacheControl, expires }); } }); return () => { request.cancel(); callback(); }; }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
(err?: Error | null, data?: ArrayBuffer | null, cacheControl?: string | null, expires?: string | null) => { if (err) { callback(err); } else if (data) { callback(null, { vectorTile: new vt.VectorTile(new Protobuf(data)), rawData: data, cacheControl, expires }); } }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
() => { request.cancel(); callback(); }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
(err, response) => { const aborted = !this.loading[uid]; delete this.loading[uid]; if (aborted || err || !response) { workerTile.status = 'done'; if (!aborted) this.loaded[uid] = workerTile; return callback(err); } const rawTileData = response.rawData; const cacheControl = {} as {expires: any; cacheControl: any}; if (response.expires) cacheControl.expires = response.expires; if (response.cacheControl) cacheControl.cacheControl = response.cacheControl; const resourceTiming = {} as {resourceTiming: any}; if (perf) { const resourceTimingData = perf.finish(); // it's necessary to eval the result of getEntriesByName() here via parse/stringify // late evaluation in the main thread causes TypeError: illegal invocation if (resourceTimingData) resourceTiming.resourceTiming = JSON.parse(JSON.stringify(resourceTimingData)); } workerTile.vectorTile = response.vectorTile; workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor, (err, result) => { if (err || !result) return callback(err); // Transferring a copy of rawTileData because the worker needs to retain its copy. callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming)); }); this.loaded = this.loaded || {}; this.loaded[uid] = workerTile; }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
(err, result) => { if (err || !result) return callback(err); // Transferring a copy of rawTileData because the worker needs to retain its copy. callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming)); }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
(err?: Error, data?: any) => { const reloadCallback = workerTile.reloadCallback; if (reloadCallback) { delete workerTile.reloadCallback; workerTile.parse(workerTile.vectorTile, vtSource.layerIndex, this.availableImages, vtSource.actor, reloadCallback); } callback(err, data); }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ClassDeclaration
/** * The {@link WorkerSource} implementation that supports {@link VectorTileSource}. * This class is designed to be easily reused to support custom source types * for data formats that can be parsed/converted into an in-memory VectorTile * representation. To do so, create it with * `new VectorTileWorkerSource(actor, styleLayers, customLoadVectorDataFunction)`. * * @private */ class VectorTileWorkerSource implements WorkerSource { actor: Actor; layerIndex: StyleLayerIndex; availableImages: Array<string>; loadVectorData: LoadVectorData; loading: {[_: string]: WorkerTile}; loaded: {[_: string]: WorkerTile}; /** * @param [loadVectorData] Optional method for custom loading of a VectorTile * object based on parameters passed from the main-thread Source. See * {@link VectorTileWorkerSource#loadTile}. The default implementation simply * loads the pbf at `params.url`. * @private */ constructor(actor: Actor, layerIndex: StyleLayerIndex, availableImages: Array<string>, loadVectorData?: LoadVectorData | null) { this.actor = actor; this.layerIndex = layerIndex; this.availableImages = availableImages; this.loadVectorData = loadVectorData || loadVectorTile; this.loading = {}; this.loaded = {}; } /** * Implements {@link WorkerSource#loadTile}. Delegates to * {@link VectorTileWorkerSource#loadVectorData} (which by default expects * a `params.url` property) for fetching and producing a VectorTile object. * @private */ loadTile(params: WorkerTileParameters, callback: WorkerTileCallback) { const uid = params.uid; const perf = (params && params.request && params.request.collectResourceTiming) ? new RequestPerformance(params.request) : false; const workerTile = this.loading[uid] = new WorkerTile(params); workerTile.abort = this.loadVectorData(params, (err, response) => { const aborted = !this.loading[uid]; delete this.loading[uid]; if (aborted || err || !response) { workerTile.status = 'done'; if (!aborted) this.loaded[uid] = workerTile; return callback(err); } const rawTileData = response.rawData; const cacheControl = {} as {expires: any; cacheControl: any}; if (response.expires) cacheControl.expires = response.expires; if (response.cacheControl) cacheControl.cacheControl = response.cacheControl; const resourceTiming = {} as {resourceTiming: any}; if (perf) { const resourceTimingData = perf.finish(); // it's necessary to eval the result of getEntriesByName() here via parse/stringify // late evaluation in the main thread causes TypeError: illegal invocation if (resourceTimingData) resourceTiming.resourceTiming = JSON.parse(JSON.stringify(resourceTimingData)); } workerTile.vectorTile = response.vectorTile; workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor, (err, result) => { if (err || !result) return callback(err); // Transferring a copy of rawTileData because the worker needs to retain its copy. callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming)); }); this.loaded = this.loaded || {}; this.loaded[uid] = workerTile; }) as AbortVectorData; } /** * Implements {@link WorkerSource#reloadTile}. * @private */ reloadTile(params: WorkerTileParameters, callback: WorkerTileCallback) { const loaded = this.loaded, uid = params.uid, vtSource = this; if (loaded && loaded[uid]) { const workerTile = loaded[uid]; workerTile.showCollisionBoxes = params.showCollisionBoxes; const done = (err?: Error, data?: any) => { const reloadCallback = workerTile.reloadCallback; if (reloadCallback) { delete workerTile.reloadCallback; workerTile.parse(workerTile.vectorTile, vtSource.layerIndex, this.availableImages, vtSource.actor, reloadCallback); } callback(err, data); }; if (workerTile.status === 'parsing') { workerTile.reloadCallback = done; } else if (workerTile.status === 'done') { // if there was no vector tile data on the initial load, don't try and re-parse tile if (workerTile.vectorTile) { workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, done); } else { done(); } } } } /** * Implements {@link WorkerSource#abortTile}. * * @param params * @param params.uid The UID for this tile. * @private */ abortTile(params: TileParameters, callback: WorkerTileCallback) { const uid = params.uid; const tile = this.loading[uid]; if (tile) { if (tile.abort) tile.abort(); delete this.loading[uid]; } callback(); } /** * Implements {@link WorkerSource#removeTile}. * * @param params * @param params.uid The UID for this tile. * @private */ removeTile(params: TileParameters, callback: WorkerTileCallback) { const loaded = this.loaded, uid = params.uid; if (loaded && loaded[uid]) { delete loaded[uid]; } callback(); } }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
TypeAliasDeclaration
export type LoadVectorTileResult = { vectorTile: VectorTile; rawData: ArrayBuffer; expires?: any; cacheControl?: any; resourceTiming?: Array<PerformanceResourceTiming>; };
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
TypeAliasDeclaration
/** * @callback LoadVectorDataCallback * @param error * @param vectorTile * @private */ export type LoadVectorDataCallback = Callback<LoadVectorTileResult>;
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
TypeAliasDeclaration
export type AbortVectorData = () => void;
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
TypeAliasDeclaration
export type LoadVectorData = (params: WorkerTileParameters, callback: LoadVectorDataCallback) => AbortVectorData | void;
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
MethodDeclaration
/** * Implements {@link WorkerSource#loadTile}. Delegates to * {@link VectorTileWorkerSource#loadVectorData} (which by default expects * a `params.url` property) for fetching and producing a VectorTile object. * @private */ loadTile(params: WorkerTileParameters, callback: WorkerTileCallback) { const uid = params.uid; const perf = (params && params.request && params.request.collectResourceTiming) ? new RequestPerformance(params.request) : false; const workerTile = this.loading[uid] = new WorkerTile(params); workerTile.abort = this.loadVectorData(params, (err, response) => { const aborted = !this.loading[uid]; delete this.loading[uid]; if (aborted || err || !response) { workerTile.status = 'done'; if (!aborted) this.loaded[uid] = workerTile; return callback(err); } const rawTileData = response.rawData; const cacheControl = {} as {expires: any; cacheControl: any}; if (response.expires) cacheControl.expires = response.expires; if (response.cacheControl) cacheControl.cacheControl = response.cacheControl; const resourceTiming = {} as {resourceTiming: any}; if (perf) { const resourceTimingData = perf.finish(); // it's necessary to eval the result of getEntriesByName() here via parse/stringify // late evaluation in the main thread causes TypeError: illegal invocation if (resourceTimingData) resourceTiming.resourceTiming = JSON.parse(JSON.stringify(resourceTimingData)); } workerTile.vectorTile = response.vectorTile; workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor, (err, result) => { if (err || !result) return callback(err); // Transferring a copy of rawTileData because the worker needs to retain its copy. callback(null, extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming)); }); this.loaded = this.loaded || {}; this.loaded[uid] = workerTile; }) as AbortVectorData; }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
MethodDeclaration
/** * Implements {@link WorkerSource#reloadTile}. * @private */ reloadTile(params: WorkerTileParameters, callback: WorkerTileCallback) { const loaded = this.loaded, uid = params.uid, vtSource = this; if (loaded && loaded[uid]) { const workerTile = loaded[uid]; workerTile.showCollisionBoxes = params.showCollisionBoxes; const done = (err?: Error, data?: any) => { const reloadCallback = workerTile.reloadCallback; if (reloadCallback) { delete workerTile.reloadCallback; workerTile.parse(workerTile.vectorTile, vtSource.layerIndex, this.availableImages, vtSource.actor, reloadCallback); } callback(err, data); }; if (workerTile.status === 'parsing') { workerTile.reloadCallback = done; } else if (workerTile.status === 'done') { // if there was no vector tile data on the initial load, don't try and re-parse tile if (workerTile.vectorTile) { workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, done); } else { done(); } } } }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
MethodDeclaration
/** * Implements {@link WorkerSource#abortTile}. * * @param params * @param params.uid The UID for this tile. * @private */ abortTile(params: TileParameters, callback: WorkerTileCallback) { const uid = params.uid; const tile = this.loading[uid]; if (tile) { if (tile.abort) tile.abort(); delete this.loading[uid]; } callback(); }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
MethodDeclaration
/** * Implements {@link WorkerSource#removeTile}. * * @param params * @param params.uid The UID for this tile. * @private */ removeTile(params: TileParameters, callback: WorkerTileCallback) { const loaded = this.loaded, uid = params.uid; if (loaded && loaded[uid]) { delete loaded[uid]; } callback(); }
sheub/maplibre-gl-js
src/source/vector_tile_worker_source.ts
TypeScript
ArrowFunction
(props) => ( <Scrollable> <TransactionForm {...props} /> </Scrollable> )
arolson101/crap
src/modals/TransactionModal.tsx
TypeScript
ArrowFunction
(props) => props.transactionId ? messages.edit : messages.create
arolson101/crap
src/modals/TransactionModal.tsx
TypeScript
TypeAliasDeclaration
type Params = TransactionForm.Props
arolson101/crap
src/modals/TransactionModal.tsx
TypeScript
InterfaceDeclaration
export default interface EventObserver { /** * Called when specific events occur during the SDK session and includes attributes of the event. * For more info visit: https://aws.amazon.com/blogs/business-productivity/monitoring-and-troubleshooting-with-amazon-chime-sdk-meeting-events/ */ eventDidReceive(name: EventName, attributes: EventAttributes): void; }
CommanderRoot/amazon-chime-sdk-js
src/eventobserver/EventObserver.ts
TypeScript
TypeAliasDeclaration
type Expression = any;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type ConditionalExpression = { type: string; test: BinaryExpression | Token; consequent: Expression; alternate: Expression; };
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type BinaryExpression = { type: string; left: Token | BinaryExpression; right: Token | BinaryExpression; operator: BinaryOperator; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Token = UnaryExpression | Object | Number | String | Arr | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type BinaryOperator = { type: string; value: string; start: number; end: number; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type UnaryExpression = { type: string; operate: { type: string; value: string; start: number; end: number; }; argument: Token; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Variable = Object | Literal | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Number = { type: string; value: number; start: number; end: number; raw: string; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type String = { type: string; value: string; start: number; end: number; raw: string; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Arguments = Array<Expression>;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Arr = { type: string; arguments: Arguments; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Object = | { type: string; computed: boolean; object: Variable | Object; property: Literal | Expression; } | Function | Literal | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Function = { type: string; callee: Variable; arguments: Arguments; } | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
TypeAliasDeclaration
type Literal = | ({ type: string; start: number; end: number; } & ( | { value: string; raw: string; } | { name?: string; } )) | null;
xingzhichen/expression-parsing
src/types/ast.d.ts
TypeScript
ClassDeclaration
@Module({ controllers: [TasksController], providers: [TaskService] }) export class TasksModule {}
yartiles-dev/proyect-nest
src/tasks/tasks.module.ts
TypeScript
ArrowFunction
({ componentId, }): JSX.Element => { const { redditStore } = useStore(); // equivalent to componentDidMount React.useEffect(() => { redditStore.fetchSubredditPosts(); }, [componentId]); useNavigationComponentDidAppear((e) => { console.log(`${e.componentName} appeared`); }, componentId); const onItemPressed = (url: string) => { Linking.canOpenURL(url) .then((supported) => { if (supported) { Linking.openURL(url); } }); }; const onRefresh = () => { redditStore.fetchSubredditPosts(); }; return useObserver(() => ( <SafeAreaView style={{ flex: 1 }}
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
() => { redditStore.fetchSubredditPosts(); }
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
(e) => { console.log(`${e.componentName} appeared`); }
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
(url: string) => { Linking.canOpenURL(url) .then((supported) => { if (supported) { Linking.openURL(url); } }); }
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
(supported) => { if (supported) { Linking.openURL(url); } }
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
() => ( <SafeAreaView style={
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
(passProps: any) => ({ topBar: { visible: true, title: { text: `r/${passProps.title}`, }, }, })
Tracklous/react-native-navigation-starter
srcMobX/screens/Land.tsx
TypeScript
ArrowFunction
(prednastavené: 52324 alebo testovacia sieť: 152324)
orientumofficial/orientum
src/qt/locale/bitcoin_sk.ts
TypeScript
ArrowFunction
(predvolené: 64897 or testnet: 164897)
orientumofficial/orientum
src/qt/locale/bitcoin_sk.ts
TypeScript
ArrowFunction
(predvolené: 127.0.0.1)
orientumofficial/orientum
src/qt/locale/bitcoin_sk.ts
TypeScript
ArrowFunction
(predvolené: 100)
orientumofficial/orientum
src/qt/locale/bitcoin_sk.ts
TypeScript
ArrowFunction
(d: string) => { console.log('onceW1Data d: ' + d); w1Stuff.push(d); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
(d: string) => { console.log('onceW2Data d: ' + d); w2Stuff.push(d); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
(chunk:string, encoding: string, pushFn: (name: string, outChunk:string) => void) => { console.log('handling chunk: ' + chunk); pushFn('w1', chunk); pushFn('w2', chunk); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
(resolve, reject) => { s.on('finish', () => { resolve() }); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
() => { resolve() }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
(d:string) => { sStuff.push(d); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
() => { expect(w1Stuff).to.have.members(['hello', 'hello2']); expect(w2Stuff).to.have.members(['hello', 'hello2']); expect(sStuff).to.have.members(['w1', 'w2', 'w1', 'w2']); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
ArrowFunction
(e) => { console.error(e.message); expect.fail(); }
cameronaaron/conversationai-crowdsource
api-service/api-server/src/setup/multiplex_transform_test.ts
TypeScript
FunctionDeclaration
function parallelTraverse(a, b, callback) { callback(a, b) for (let i = 0; i < a.children.length; i++) { parallelTraverse(a.children[i], b.children[i], callback) } }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
ArrowFunction
(sourceNode, clonedNode) => { sourceLookup.set(clonedNode, sourceNode) cloneLookup.set(sourceNode, clonedNode) }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
ArrowFunction
(node) => { if (!node.isSkinnedMesh) return const clonedMesh = node const sourceMesh = sourceLookup.get(node) const sourceBones = sourceMesh.skeleton.bones clonedMesh.skeleton = sourceMesh.skeleton.clone() clonedMesh.bindMatrix.copy(sourceMesh.bindMatrix) clonedMesh.skeleton.bones = sourceBones.map((bone) => { if (!cloneLookup.has(bone)) { console.warn( 'Bone was not cloned', bone, '. Common reason is that bones parent is out of clone source', source ) } return cloneLookup.get(bone) }) clonedMesh.bind(clonedMesh.skeleton, clonedMesh.bindMatrix) }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
ArrowFunction
(bone) => { if (!cloneLookup.has(bone)) { console.warn( 'Bone was not cloned', bone, '. Common reason is that bones parent is out of clone source', source ) } return cloneLookup.get(bone) }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
InterfaceDeclaration
interface ShortOptions { names?: any hip?: string }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
InterfaceDeclaration
interface RetargetOptions { useFirstFramePosition?: boolean fps?: number names?: any hip?: string }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
InterfaceDeclaration
interface Options { preserveMatrix?: boolean preservePosition?: boolean preserveHipPosition?: boolean useTargetMatrix?: boolean hip?: string names?: any offsets?: any }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static retarget(target, source, options: Options) { if (!options) options = { preserveMatrix: true, preservePosition: true, preserveHipPosition: false, useTargetMatrix: false, hip: 'hip', names: {} } const pos = new Vector3(), quat = new Quaternion(), scale = new Vector3(), bindBoneMatrix = new Matrix4(), relativeMatrix = new Matrix4(), globalMatrix = new Matrix4() options.preserveMatrix = options.preserveMatrix !== undefined ? options.preserveMatrix : true options.preservePosition = options.preservePosition !== undefined ? options.preservePosition : true options.preserveHipPosition = options.preserveHipPosition !== undefined ? options.preserveHipPosition : false options.useTargetMatrix = options.useTargetMatrix !== undefined ? options.useTargetMatrix : false options.hip = options.hip !== undefined ? options.hip : 'hip' options.names = options.names || {} const sourceBones = source.isObject3D ? source.skeleton.bones : this.getBones(source), bones = target.isObject3D ? target.skeleton.bones : this.getBones(target) let bindBones, bone, name, boneTo, bonesPosition // reset bones if (target.isObject3D) { target.skeleton.pose() } else { options.useTargetMatrix = true options.preserveMatrix = false } if (options.preservePosition) { bonesPosition = [] for (let i = 0; i < bones.length; i++) { bonesPosition.push(bones[i].position.clone()) } } if (options.preserveMatrix) { // reset matrix target.updateMatrixWorld() target.matrixWorld.identity() // reset children matrix for (let i = 0; i < target.children.length; ++i) { target.children[i].updateMatrixWorld(true) } } if (options.offsets) { bindBones = [] for (let i = 0; i < bones.length; ++i) { bone = bones[i] name = options.names[bone.name] || bone.name if (options.offsets && options.offsets[name]) { bone.matrix.multiply(options.offsets[name]) bone.matrix.decompose(bone.position, bone.quaternion, bone.scale) bone.updateMatrixWorld() } bindBones.push(bone.matrixWorld.clone()) } } for (let i = 0; i < bones.length; ++i) { bone = bones[i] name = options.names[bone.name] || bone.name boneTo = this.getBoneByName(name, sourceBones) globalMatrix.copy(bone.matrixWorld) if (boneTo) { boneTo.updateMatrixWorld() if (options.useTargetMatrix) { relativeMatrix.copy(boneTo.matrixWorld) } else { relativeMatrix.copy(target.matrixWorld).invert() relativeMatrix.multiply(boneTo.matrixWorld) } // ignore scale to extract rotation scale.setFromMatrixScale(relativeMatrix) relativeMatrix.scale(scale.set(1 / scale.x, 1 / scale.y, 1 / scale.z)) // apply to global matrix globalMatrix.makeRotationFromQuaternion(quat.setFromRotationMatrix(relativeMatrix)) if (target.isObject3D) { const boneIndex = bones.indexOf(bone), wBindMatrix = bindBones ? bindBones[boneIndex] : bindBoneMatrix.copy(target.skeleton.boneInverses[boneIndex]).invert() globalMatrix.multiply(wBindMatrix) } globalMatrix.copyPosition(relativeMatrix) } if (bone.parent && bone.parent.isBone) { bone.matrix.copy(bone.parent.matrixWorld).invert() bone.matrix.multiply(globalMatrix) } else { bone.matrix.copy(globalMatrix) } if (options.preserveHipPosition && name === options.hip) { bone.matrix.setPosition(pos.set(0, bone.position.y, 0)) } bone.matrix.decompose(bone.position, bone.quaternion, bone.scale) bone.updateMatrixWorld() } if (options.preservePosition) { for (let i = 0; i < bones.length; ++i) { bone = bones[i] name = options.names[bone.name] || bone.name if (name !== options.hip) { bone.position.copy(bonesPosition[i]) } } } if (options.preserveMatrix) { // restore matrix target.updateMatrixWorld(true) } }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static retargetClip(target, source, clip, options: RetargetOptions = {}) { options.useFirstFramePosition = options.useFirstFramePosition !== undefined ? options.useFirstFramePosition : false options.fps = options.fps !== undefined ? options.fps : 30 options.names = options.names || [] if (!source.isObject3D) { source = this.getHelperFromSkeleton(source) } const numFrames = Math.round(clip.duration * (options.fps / 1000) * 1000), delta = 1 / options.fps, convertedTracks: (VectorKeyframeTrack | QuaternionKeyframeTrack)[] = [], mixer = new AnimationMixer(source), bones = this.getBones(target.skeleton), boneDatas = [] let positionOffset, bone, boneTo, boneData, name mixer.clipAction(clip).play() mixer.update(0) source.updateMatrixWorld() for (let i = 0; i < numFrames; ++i) { const time = i * delta this.retarget(target, source, options) for (let j = 0; j < bones.length; ++j) { name = options.names[bones[j].name] || bones[j].name boneTo = this.getBoneByName(name, source.skeleton) if (boneTo) { bone = bones[j] boneData = boneDatas[j] = boneDatas[j] || { bone: bone } if (options.hip === name) { if (!boneData.pos) { boneData.pos = { times: new Float32Array(numFrames), values: new Float32Array(numFrames * 3) } } if (options.useFirstFramePosition) { if (i === 0) { positionOffset = bone.position.clone() } bone.position.sub(positionOffset) } boneData.pos.times[i] = time bone.position.toArray(boneData.pos.values, i * 3) } if (!boneData.quat) { boneData.quat = { times: new Float32Array(numFrames), values: new Float32Array(numFrames * 4) } } boneData.quat.times[i] = time bone.quaternion.toArray(boneData.quat.values, i * 4) } } mixer.update(delta) source.updateMatrixWorld() } for (let i = 0; i < boneDatas.length; ++i) { boneData = boneDatas[i] if (boneData) { if (boneData.pos) { convertedTracks.push( new VectorKeyframeTrack( '.bones[' + boneData.bone.name + '].position', boneData.pos.times, boneData.pos.values ) ) } convertedTracks.push( new QuaternionKeyframeTrack( '.bones[' + boneData.bone.name + '].quaternion', boneData.quat.times, boneData.quat.values ) ) } } mixer.uncacheAction(clip) return new AnimationClip(clip.name, -1, convertedTracks) }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getHelperFromSkeleton(skeleton) { const source = new SkeletonHelper(skeleton.bones[0]) ;(source as any).skeleton = skeleton return source }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getSkeletonOffsets(target, source, options: ShortOptions = {}) { const targetParentPos = new Vector3(), targetPos = new Vector3(), sourceParentPos = new Vector3(), sourcePos = new Vector3(), targetDir = new Vector2(), sourceDir = new Vector2() options.hip = options.hip !== undefined ? options.hip : 'hip' options.names = options.names || {} if (!source.isObject3D) { source = this.getHelperFromSkeleton(source) } const nameKeys = Object.keys(options.names), nameValues = Object.values(options.names), sourceBones = source.isObject3D ? source.skeleton.bones : this.getBones(source), bones = target.isObject3D ? target.skeleton.bones : this.getBones(target), offsets: Matrix4[] = [] let bone, boneTo, name, i target.skeleton.pose() for (i = 0; i < bones.length; ++i) { bone = bones[i] name = options.names[bone.name] || bone.name boneTo = this.getBoneByName(name, sourceBones) if (boneTo && name !== options.hip) { const boneParent = this.getNearestBone(bone.parent, nameKeys), boneToParent = this.getNearestBone(boneTo.parent, nameValues) boneParent.updateMatrixWorld() boneToParent.updateMatrixWorld() targetParentPos.setFromMatrixPosition(boneParent.matrixWorld) targetPos.setFromMatrixPosition(bone.matrixWorld) sourceParentPos.setFromMatrixPosition(boneToParent.matrixWorld) sourcePos.setFromMatrixPosition(boneTo.matrixWorld) targetDir .subVectors(new Vector2(targetPos.x, targetPos.y), new Vector2(targetParentPos.x, targetParentPos.y)) .normalize() sourceDir .subVectors(new Vector2(sourcePos.x, sourcePos.y), new Vector2(sourceParentPos.x, sourceParentPos.y)) .normalize() const laterialAngle = targetDir.angle() - sourceDir.angle() const offset = new Matrix4().makeRotationFromEuler(new Euler(0, 0, laterialAngle)) bone.matrix.multiply(offset) bone.matrix.decompose(bone.position, bone.quaternion, bone.scale) bone.updateMatrixWorld() offsets[name] = offset } } return offsets }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static renameBones(skeleton, names) { const bones = this.getBones(skeleton) for (let i = 0; i < bones.length; ++i) { const bone = bones[i] if (names[bone.name]) { bone.name = names[bone.name] } } return this }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getBones(skeleton) { return Array.isArray(skeleton) ? skeleton : skeleton.bones }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getBoneByName(name, skeleton) { for (let i = 0, bones = this.getBones(skeleton); i < bones.length; i++) { if (name === bones[i].name) return bones[i] } }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getNearestBone(bone, names) { while (bone.isBone) { if (names.indexOf(bone.name) !== -1) { return bone } bone = bone.parent } }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static findBoneTrackData(name, tracks) { const regexp = /\[(.*)\]\.(.*)/, result = { name: name } for (let i = 0; i < tracks.length; ++i) { // 1 is track name // 2 is track type const trackData = regexp.exec(tracks[i].name) if (trackData && name === trackData[1]) { result[trackData[2]] = i } } return result }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static getEqualsBonesNames(skeleton, targetSkeleton) { const sourceBones = this.getBones(skeleton), targetBones = this.getBones(targetSkeleton), bones: any = [] search: for (let i = 0; i < sourceBones.length; i++) { const boneName = sourceBones[i].name for (let j = 0; j < targetBones.length; j++) { if (boneName === targetBones[j].name) { bones.push(boneName) continue search } } } return bones }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
MethodDeclaration
static clone(source) { const sourceLookup = new Map() const cloneLookup = new Map() const clone = source.clone() parallelTraverse(source, clone, (sourceNode, clonedNode) => { sourceLookup.set(clonedNode, sourceNode) cloneLookup.set(sourceNode, clonedNode) }) clone.traverse((node) => { if (!node.isSkinnedMesh) return const clonedMesh = node const sourceMesh = sourceLookup.get(node) const sourceBones = sourceMesh.skeleton.bones clonedMesh.skeleton = sourceMesh.skeleton.clone() clonedMesh.bindMatrix.copy(sourceMesh.bindMatrix) clonedMesh.skeleton.bones = sourceBones.map((bone) => { if (!cloneLookup.has(bone)) { console.warn( 'Bone was not cloned', bone, '. Common reason is that bones parent is out of clone source', source ) } return cloneLookup.get(bone) }) clonedMesh.bind(clonedMesh.skeleton, clonedMesh.bindMatrix) }) return clone }
Abhishek-Pathak-Here/xr3ngine
packages/engine/src/avatar/SkeletonUtils.ts
TypeScript
ArrowFunction
async ({ response }) => { return response.send('<a href="/apple/redirect">Login with Apple</a>') }
bitkidd/adonis-ally
examples/apple.ts
TypeScript
ArrowFunction
async ({ ally }) => { return ally.use('apple').redirect((request) => { request.scopes(['email', 'name']) }) }
bitkidd/adonis-ally
examples/apple.ts
TypeScript
ArrowFunction
(request) => { request.scopes(['email', 'name']) }
bitkidd/adonis-ally
examples/apple.ts
TypeScript