type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
() => { return ( <Button rightIcon={<ExternalLinkIcon />}
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
ArrowFunction
() => { if (!sortedPublications.length) { return ( <Stack mx="auto" textAlign="center"> <Image src="/images/common/no-items.svg" alt="No publications found!" size={64} /> <Text>No publications found!</Text> </Stack>
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
ArrowFunction
(publication: IPublication, index: number) => { return ( <Box key={index} bg={cardBgColor[colorMode]} color={cardColor[colorMode]} p={8} rounded="md" shadow="md" > <a href={publication.url} target="_blank" rel="noopener"> <Box> <Stack spacing={4}> {dateNode(publication.date
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
InterfaceDeclaration
interface Props { publications: IPublication[]; hideViewAllLinksNode?: boolean; }
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
MethodDeclaration
dayjs(date)
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
MethodDeclaration
dateNode(publication
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
MethodDeclaration
ctaNode()
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
MethodDeclaration
headingNode()
ratheeps/ratheep.dev
components/layouts/publications/index.tsx
TypeScript
FunctionDeclaration
function on
webosce/ime-manager
resources/bg/imemanager_bg.ts
TypeScript
ArrowFunction
(_, args, { api }) => api.storesCount()
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, args, { api }) => api.creatorsCount()
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, args, { api }) => api.artworksCount()
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, args, { api }) => api.auctionsCount()
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, args, { api }) => api.getStores()
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, { storeId }, { api }) => api.getStore(storeId)
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
(_, { storeId }, { api }) => api.getCreators(storeId)
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
async (_, { storeId, creatorId }, { api }) => api.getCreator(storeId, creatorId)
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
async (_, { filter }, { api }) => api.getArtworks(filter)
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
ArrowFunction
async (_, { artId }, { api }) => api.getArtwork(artId)
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
MethodDeclaration
definition(t) { t.field('storesCount', { type: 'Int', resolve: (_, args, { api }) => api.storesCount(), }); t.field('creatorsCount', { type: 'Int', resolve: (_, args, { api }) => api.creatorsCount(), }); t.field('artworksCount', { type: 'Int', resolve: (_, args, { api }) => api.artworksCount(), }); t.field('auctionsCount', { type: 'Int', resolve: (_, args, { api }) => api.auctionsCount(), }); t.field('stores', { type: list(nonNull(Store)), resolve: (_, args, { api }) => api.getStores(), }); t.field('store', { type: Store, args: { storeId: nonNull(stringArg()), }, resolve: (_, { storeId }, { api }) => api.getStore(storeId), }); t.field('creators', { type: list(nonNull(Creator)), args: { storeId: nonNull(stringArg()), }, resolve: (_, { storeId }, { api }) => api.getCreators(storeId), }); t.field('creator', { type: Creator, args: { storeId: nonNull(stringArg()), creatorId: nonNull(stringArg()), }, resolve: async (_, { storeId, creatorId }, { api }) => api.getCreator(storeId, creatorId), }); t.field('artworks', { type: list(nonNull(Artwork)), args: { filter: nonNull(ArtworksInput.asArg()) }, resolve: async (_, { filter }, { api }) => api.getArtworks(filter), }); t.field('artwork', { type: Artwork, args: { storeId: stringArg(), artId: nonNull(stringArg()) }, resolve: async (_, { artId }, { api }) => api.getArtwork(artId), }); }
007zzzzzz/metaplex
js/packages/graphql/src/schema/query.ts
TypeScript
FunctionDeclaration
export function Profile () { const { level } = useContext(ChallengesContext); return ( <div className={styles.profileContainer}> <img src="https://github.com/FlavioInacio-jf.png" alt="Flávio Inácio"></img> <div> <strong>Flávio Inácio</strong> <p> <img src="icons/level.svg" alt="level"/> level {level} </p> </div> </div> ); }
FlavioInacio-jf/moveat
src/components/Profile.tsx
TypeScript
ArrowFunction
(rmrkString: string): RmrkEvent => { if (RmrkActionRegex.MINT.test(rmrkString)) { return RmrkEvent.MINT } if (RmrkActionRegex.MINTNFT.test(rmrkString)) { return RmrkEvent.MINTNFT } if (RmrkActionRegex.SEND.test(rmrkString)) { return RmrkEvent.SEND } if (RmrkActionRegex.BUY.test(rmrkString)) { return RmrkEvent.BUY } if (RmrkActionRegex.CONSUME.test(rmrkString)) { return RmrkEvent.CONSUME } if (RmrkActionRegex.CHANGEISSUER.test(rmrkString)) { return RmrkEvent.CHANGEISSUER } if (RmrkActionRegex.LIST.test(rmrkString)) { return RmrkEvent.LIST } if (RmrkActionRegex.EMOTE.test(rmrkString)) { return RmrkEvent.EMOTE } throw new EvalError(`[NFTUtils] Unable to get action from ${rmrkString}`); }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
ClassDeclaration
class NFTUtils { public static decode(value: string) { return decodeURIComponent(value); } public static decodeRmrk(rmrkString: string): string { return NFTUtils.decode( isHex(rmrkString) ? hexToString(rmrkString) : rmrkString ); } public static convert(rmrkString: string): RMRK { try { return { event: NFTUtils.getAction(rmrkString), view: NFTUtils.unwrap(rmrkString) } } catch(e) { throw e } } public static toString(rmrkType: NFT | Collection, version: string = 'RMRK1.0.0'): string { if (NFTUtils.isCollection(rmrkType)) { return NFTUtils.encodeCollection(rmrkType, version) } if (NFTUtils.isNFT(rmrkType)) { return NFTUtils.encodeNFT(rmrkType, version) } return '' } public static encodeCollection(collection: Collection, version: string) { return `RMRK::MINT::${version}::${encodeURIComponent( JSON.stringify(collection) )}`; } protected static encodeNFT(nft: NFT, version: string) { return `RMRK::MINTNFT::${version}::${encodeURIComponent( JSON.stringify(nft) )}` } public static collectionFromNFT(symbol: string, nft: NFT, version: string = 'RMRK1.0.0'): Collection { return { id: generateId(nft.currentOwner, symbol), _id: '', symbol: slugify(symbol, '_').toUpperCase(), issuer: nft.currentOwner, version, name: nft.name, max: 1, metadata: nft.metadata } } public static isCollection(object: Collection | NFT): object is Collection { return 'issuer' in object && 'symbol' in object; } public static isNFT(object: Collection | NFT): object is NFT { return 'currentOwner' in object && 'instance' in object; } public static decodeAndConvert(rmrkString: string) { return NFTUtils.convert(NFTUtils.decodeRmrk(rmrkString)) } public static getAction = (rmrkString: string): RmrkEvent => { if (RmrkActionRegex.MINT.test(rmrkString)) { return RmrkEvent.MINT } if (RmrkActionRegex.MINTNFT.test(rmrkString)) { return RmrkEvent.MINTNFT } if (RmrkActionRegex.SEND.test(rmrkString)) { return RmrkEvent.SEND } if (RmrkActionRegex.BUY.test(rmrkString)) { return RmrkEvent.BUY } if (RmrkActionRegex.CONSUME.test(rmrkString)) { return RmrkEvent.CONSUME } if (RmrkActionRegex.CHANGEISSUER.test(rmrkString)) { return RmrkEvent.CHANGEISSUER } if (RmrkActionRegex.LIST.test(rmrkString)) { return RmrkEvent.LIST } if (RmrkActionRegex.EMOTE.test(rmrkString)) { return RmrkEvent.EMOTE } throw new EvalError(`[NFTUtils] Unable to get action from ${rmrkString}`); } public static unwrap(rmrkString: string): any { const rr: RegExp = /{.*}/ const match = rmrkString.match(rr) if (match) { return JSON.parse(match[0]) } const split = rmrkString.split(SQUARE) if (split.length >= 4) { return ({ id: split[3], metadata: split[4] } as RmrkInteraction) } throw new TypeError(`RMRK: Unable to unwrap object ${rmrkString}`) } }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
ClassDeclaration
class RmrkActionRegex { static MINTNFT = /^[rR][mM][rR][kK]::MINTNFT::/; static MINT = /^[rR][mM][rR][kK]::MINT::/; static SEND = /^[rR][mM][rR][kK]::SEND::/; static BUY = /^[rR][mM][rR][kK]::BUY::/; static CONSUME = /^[rR][mM][rR][kK]::CONSUME::/; static CHANGEISSUER = /^[rR][mM][rR][kK]::CHANGEISSUER::/; static LIST = /^[rR][mM][rR][kK]::LIST::/; static EMOTE = /^[rR][mM][rR][kK]::EMOTE::/; }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static decode(value: string) { return decodeURIComponent(value); }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static decodeRmrk(rmrkString: string): string { return NFTUtils.decode( isHex(rmrkString) ? hexToString(rmrkString) : rmrkString ); }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static convert(rmrkString: string): RMRK { try { return { event: NFTUtils.getAction(rmrkString), view: NFTUtils.unwrap(rmrkString) } } catch(e) { throw e } }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static toString(rmrkType: NFT | Collection, version: string = 'RMRK1.0.0'): string { if (NFTUtils.isCollection(rmrkType)) { return NFTUtils.encodeCollection(rmrkType, version) } if (NFTUtils.isNFT(rmrkType)) { return NFTUtils.encodeNFT(rmrkType, version) } return '' }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static encodeCollection(collection: Collection, version: string) { return `RMRK::MINT::${version}::${encodeURIComponent( JSON.stringify(collection) )}`; }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
protected static encodeNFT(nft: NFT, version: string) { return `RMRK::MINTNFT::${version}::${encodeURIComponent( JSON.stringify(nft) )}` }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static collectionFromNFT(symbol: string, nft: NFT, version: string = 'RMRK1.0.0'): Collection { return { id: generateId(nft.currentOwner, symbol), _id: '', symbol: slugify(symbol, '_').toUpperCase(), issuer: nft.currentOwner, version, name: nft.name, max: 1, metadata: nft.metadata } }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static isCollection(object: Collection | NFT): object is Collection { return 'issuer' in object && 'symbol' in object; }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static isNFT(object: Collection | NFT): object is NFT { return 'currentOwner' in object && 'instance' in object; }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static decodeAndConvert(rmrkString: string) { return NFTUtils.convert(NFTUtils.decodeRmrk(rmrkString)) }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
MethodDeclaration
public static unwrap(rmrkString: string): any { const rr: RegExp = /{.*}/ const match = rmrkString.match(rr) if (match) { return JSON.parse(match[0]) } const split = rmrkString.split(SQUARE) if (split.length >= 4) { return ({ id: split[3], metadata: split[4] } as RmrkInteraction) } throw new TypeError(`RMRK: Unable to unwrap object ${rmrkString}`) }
Luigi2110/nft-gallery
dashboard/src/components/rmrk/service/NftUtils.ts
TypeScript
FunctionDeclaration
/** Spin up the "auto" node API and provide it the parsed CLI args. */ export async function run(command: string, args: ApiOptions) { const auto = new Auto(args); try { if (command === 'init') { await auto.init(); return; } await auto.loadConfig(); if (args.verbose || command === 'info') { const { hasError } = await auto.info(); if (command === 'info') { if (hasError) { process.exit(1); } else { return; } } } switch (command) { case 'create-labels': await auto.createLabels(args as ICreateLabelsOptions); break; case 'label': await auto.label(args as ILabelOptions); break; case 'pr-check': await auto.prCheck(args as IPRCheckOptions); break; case 'pr-status': await auto.prStatus(args as IPRStatusOptions); break; case 'comment': await auto.comment(args as ICommentOptions); break; case 'pr-body': await auto.prBody(args as IPRBodyOptions); break; case 'version': await auto.version(args as IVersionOptions); break; case 'changelog': await auto.changelog(args as IChangelogOptions); break; case 'release': await auto.runRelease(args as IReleaseOptions); break; case 'shipit': await auto.shipit(args as IShipItOptions); break; case 'latest': await auto.latest(args as IShipItOptions); break; case 'canary': await auto.canary(args as ICanaryOptions); break; case 'next': await auto.next(args as INextOptions); break; default: throw new Error(`idk what i'm doing.`); } } catch (error) { if (error.status === 404) { const [, project] = await on(auto.git!.getProject()); const repoLink = link( `${auto.git?.options.owner}/${auto.git?.options.repo}`, project?.html_url || '' ); auto.logger.log.error(endent` Received 404! This usually because the GitHub token you're using doesn't have the correct permissions to the repo. The token used with auto must have at least "write" permission to your repo (${repoLink}) to create releases and labels. You can check the permission for you token by running "auto info". `); console.log(''); auto.logger.verbose.error(error.request); } else { console.log(error); } process.exit(1); } }
sugarmanz/auto
packages/cli/src/run.ts
TypeScript
FunctionDeclaration
/** Run "auto" for a given command. */ export default async function main(command: string, args: ApiOptions) { await run(command, args); }
sugarmanz/auto
packages/cli/src/run.ts
TypeScript
FunctionDeclaration
export function seedUserStore() { users.set('[email protected]', { password: '123456', permissions: ['users.list', 'users.create', 'metrics.list'], roles: ['administrator'] }); users.set('[email protected]', { password: '654321', permissions: ['users.list', 'metrics.list'], roles: ['editor'] }); }
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
FunctionDeclaration
export function createRefreshToken(email: string) { const currentUserTokens = tokens.get(email) ?? []; const refreshToken = uuid(); tokens.set(email, [...currentUserTokens, refreshToken]); return refreshToken; }
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
FunctionDeclaration
export function checkRefreshTokenIsValid(email: string, refreshToken: string) { const storedRefreshTokens = tokens.get(email) ?? []; return storedRefreshTokens.some(token => token === refreshToken); }
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
FunctionDeclaration
export function invalidateRefreshToken(email: string, refreshToken: string) { const storedRefreshTokens = tokens.get(email) ?? []; tokens.set( email, storedRefreshTokens.filter(token => token !== refreshToken) ); }
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
ArrowFunction
token => token === refreshToken
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
ArrowFunction
token => token !== refreshToken
robertomorel/reactjs-next-auth-jwt
packages/api/src/database.ts
TypeScript
ClassDeclaration
export abstract class Geometry { public readonly transform: Transform; public readonly tileRange: Range3d; public readonly displayParams: DisplayParams; public constructor(transform: Transform, tileRange: Range3d, displayParams: DisplayParams) { this.transform = transform; this.tileRange = tileRange; this.displayParams = displayParams; } public static createFromPointString(pts: Point3d[], tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitivePointStringGeometry(pts, tf, tileRange, params); } public static createFromLineString(pts: Point3d[], tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitiveLineStringGeometry(pts, tf, tileRange, params); } public static createFromLoop(loop: Loop, tf: Transform, tileRange: Range3d, params: DisplayParams, disjoint: boolean): Geometry { return new PrimitiveLoopGeometry(loop, tf, tileRange, params, disjoint); } public static createFromPath(path: Path, tf: Transform, tileRange: Range3d, params: DisplayParams, disjoint: boolean): Geometry { return new PrimitivePathGeometry(path, tf, tileRange, params, disjoint); } public static createFromPolyface(ipf: IndexedPolyface, tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitivePolyfaceGeometry(ipf, tf, tileRange, params); } protected abstract _getPolyfaces(facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined; protected abstract _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined; public getPolyfaces(tolerance: number): PolyfacePrimitiveList | undefined { const facetOptions = StrokeOptions.createForFacets(); facetOptions.chordTol = tolerance; if (this.displayParams.isTextured) facetOptions.needParams = true; // if (!this.displayParams.ignoreLighting) // ###TODO And not 2D... // facetOptions.needNormals = true; return this._getPolyfaces(facetOptions); } public getStrokes(tolerance: number): StrokesPrimitiveList | undefined { const strokeOptions = StrokeOptions.createForCurves(); strokeOptions.chordTol = tolerance; return this._getStrokes(strokeOptions); } public get hasTexture() { return this.displayParams.isTextured; } public doDecimate() { return false; } public doVertexCluster() { return true; } public part() { return undefined; } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
ClassDeclaration
export class PrimitivePathGeometry extends Geometry { public readonly path: Path; public readonly isDisjoint: boolean; public constructor(path: Path, tf: Transform, range: Range3d, params: DisplayParams, isDisjoint: boolean) { super(tf, range, params); this.path = path; this.isDisjoint = isDisjoint; } protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { return undefined; } protected _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return PrimitivePathGeometry.getStrokesForLoopOrPath(this.path, facetOptions, this.displayParams, this.isDisjoint, this.transform); } public static getStrokesForLoopOrPath(loopOrPath: Loop | Path, facetOptions: StrokeOptions, params: DisplayParams, isDisjoint: boolean, transform: Transform): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); if (!loopOrPath.isAnyRegionType || params.wantRegionOutline) { const strksPts: StrokesPrimitivePointLists = new StrokesPrimitivePointLists(); PrimitivePathGeometry.collectCurveStrokes(strksPts, loopOrPath, facetOptions, transform); if (strksPts.length > 0) { const isPlanar = loopOrPath.isAnyRegionType; assert(isPlanar === params.wantRegionOutline); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(params, isDisjoint, isPlanar); strksPrim.strokes = strksPts; strksList.push(strksPrim); } } return strksList; } private static collectCurveStrokes(strksPts: StrokesPrimitivePointLists, loopOrPath: CurveChain, facetOptions: StrokeOptions, trans: Transform) { const strokes = loopOrPath.getPackedStrokes(facetOptions); if (undefined !== strokes) { const pts = strokes.getPoint3dArray(); trans.multiplyPoint3dArrayInPlace(pts); strksPts.push(new StrokesPrimitivePointList(pts)); } } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
ClassDeclaration
export class PrimitivePointStringGeometry extends Geometry { public readonly pts: Point3d[]; public constructor(pts: Point3d[], tf: Transform, range: Range3d, params: DisplayParams) { super(tf, range, params); this.pts = pts; } protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { return undefined; } protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); const strksPts = new StrokesPrimitivePointLists(new StrokesPrimitivePointList(this.pts)); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(this.displayParams, true, false); strksPrim.strokes = strksPts; strksPrim.transform(this.transform); strksList.push(strksPrim); return strksList; } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
ClassDeclaration
export class PrimitiveLineStringGeometry extends Geometry { public readonly pts: Point3d[]; public constructor(pts: Point3d[], tf: Transform, range: Range3d, params: DisplayParams) { super(tf, range, params); this.pts = pts; } protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { return undefined; } protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); const strksPts = new StrokesPrimitivePointLists(new StrokesPrimitivePointList(this.pts)); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(this.displayParams, false, false); strksPrim.strokes = strksPts; strksPrim.transform(this.transform); strksList.push(strksPrim); return strksList; } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
ClassDeclaration
export class PrimitiveLoopGeometry extends Geometry { public readonly loop: Loop; public readonly isDisjoint: boolean; public constructor(loop: Loop, tf: Transform, range: Range3d, params: DisplayParams, isDisjoint: boolean) { super(tf, range, params); this.loop = loop; this.isDisjoint = isDisjoint; } protected _getPolyfaces(facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { if (!this.loop.isAnyRegionType) { return undefined; } // The following is good for single loop things according to Earlin. const contour = SweepContour.createForLinearSweep(this.loop); if (contour !== undefined) { const pfBuilder: PolyfaceBuilder = PolyfaceBuilder.create(facetOptions); contour.emitFacets(pfBuilder, false, this.transform); // build facets and emit them to the builder const polyface = pfBuilder.claimPolyface(); const wantEdges = DisplayParams.RegionEdgeType.Default === this.displayParams.regionEdgeType; const isPlanar = true; return new PolyfacePrimitiveList(PolyfacePrimitive.create(this.displayParams, polyface, wantEdges, isPlanar)); } // ###TODO: this approach might not work with holes return undefined; } protected _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return PrimitivePathGeometry.getStrokesForLoopOrPath(this.loop, facetOptions, this.displayParams, this.isDisjoint, this.transform); } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
ClassDeclaration
export class PrimitivePolyfaceGeometry extends Geometry { public readonly polyface: IndexedPolyface; public constructor(polyface: IndexedPolyface, tf: Transform, range: Range3d, params: DisplayParams) { super(tf, range, params); this.polyface = polyface; } protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { if (!this.hasTexture) { // clear parameters if (this.polyface.data.param) { this.polyface.data.param.clear(); } if (this.polyface.data.paramIndex) { this.polyface.data.paramIndex = []; } } assert(this.transform.isIdentity); return new PolyfacePrimitiveList(PolyfacePrimitive.create(this.displayParams, this.polyface)); } protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return undefined; } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
TypeAliasDeclaration
export type PrimitiveGeometryType = Loop | Path | IndexedPolyface;
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static createFromPointString(pts: Point3d[], tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitivePointStringGeometry(pts, tf, tileRange, params); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static createFromLineString(pts: Point3d[], tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitiveLineStringGeometry(pts, tf, tileRange, params); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static createFromLoop(loop: Loop, tf: Transform, tileRange: Range3d, params: DisplayParams, disjoint: boolean): Geometry { return new PrimitiveLoopGeometry(loop, tf, tileRange, params, disjoint); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static createFromPath(path: Path, tf: Transform, tileRange: Range3d, params: DisplayParams, disjoint: boolean): Geometry { return new PrimitivePathGeometry(path, tf, tileRange, params, disjoint); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static createFromPolyface(ipf: IndexedPolyface, tf: Transform, tileRange: Range3d, params: DisplayParams): Geometry { return new PrimitivePolyfaceGeometry(ipf, tf, tileRange, params); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected abstract _getPolyfaces(facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined;
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected abstract _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined;
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public getPolyfaces(tolerance: number): PolyfacePrimitiveList | undefined { const facetOptions = StrokeOptions.createForFacets(); facetOptions.chordTol = tolerance; if (this.displayParams.isTextured) facetOptions.needParams = true; // if (!this.displayParams.ignoreLighting) // ###TODO And not 2D... // facetOptions.needNormals = true; return this._getPolyfaces(facetOptions); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public getStrokes(tolerance: number): StrokesPrimitiveList | undefined { const strokeOptions = StrokeOptions.createForCurves(); strokeOptions.chordTol = tolerance; return this._getStrokes(strokeOptions); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public doDecimate() { return false; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public doVertexCluster() { return true; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public part() { return undefined; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { return undefined; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return PrimitivePathGeometry.getStrokesForLoopOrPath(this.path, facetOptions, this.displayParams, this.isDisjoint, this.transform); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
public static getStrokesForLoopOrPath(loopOrPath: Loop | Path, facetOptions: StrokeOptions, params: DisplayParams, isDisjoint: boolean, transform: Transform): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); if (!loopOrPath.isAnyRegionType || params.wantRegionOutline) { const strksPts: StrokesPrimitivePointLists = new StrokesPrimitivePointLists(); PrimitivePathGeometry.collectCurveStrokes(strksPts, loopOrPath, facetOptions, transform); if (strksPts.length > 0) { const isPlanar = loopOrPath.isAnyRegionType; assert(isPlanar === params.wantRegionOutline); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(params, isDisjoint, isPlanar); strksPrim.strokes = strksPts; strksList.push(strksPrim); } } return strksList; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
private static collectCurveStrokes(strksPts: StrokesPrimitivePointLists, loopOrPath: CurveChain, facetOptions: StrokeOptions, trans: Transform) { const strokes = loopOrPath.getPackedStrokes(facetOptions); if (undefined !== strokes) { const pts = strokes.getPoint3dArray(); trans.multiplyPoint3dArrayInPlace(pts); strksPts.push(new StrokesPrimitivePointList(pts)); } }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { return undefined; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); const strksPts = new StrokesPrimitivePointLists(new StrokesPrimitivePointList(this.pts)); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(this.displayParams, true, false); strksPrim.strokes = strksPts; strksPrim.transform(this.transform); strksList.push(strksPrim); return strksList; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { const strksList = new StrokesPrimitiveList(); const strksPts = new StrokesPrimitivePointLists(new StrokesPrimitivePointList(this.pts)); const strksPrim: StrokesPrimitive = StrokesPrimitive.create(this.displayParams, false, false); strksPrim.strokes = strksPts; strksPrim.transform(this.transform); strksList.push(strksPrim); return strksList; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getPolyfaces(facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { if (!this.loop.isAnyRegionType) { return undefined; } // The following is good for single loop things according to Earlin. const contour = SweepContour.createForLinearSweep(this.loop); if (contour !== undefined) { const pfBuilder: PolyfaceBuilder = PolyfaceBuilder.create(facetOptions); contour.emitFacets(pfBuilder, false, this.transform); // build facets and emit them to the builder const polyface = pfBuilder.claimPolyface(); const wantEdges = DisplayParams.RegionEdgeType.Default === this.displayParams.regionEdgeType; const isPlanar = true; return new PolyfacePrimitiveList(PolyfacePrimitive.create(this.displayParams, polyface, wantEdges, isPlanar)); } // ###TODO: this approach might not work with holes return undefined; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getStrokes(facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return PrimitivePathGeometry.getStrokesForLoopOrPath(this.loop, facetOptions, this.displayParams, this.isDisjoint, this.transform); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getPolyfaces(_facetOptions: StrokeOptions): PolyfacePrimitiveList | undefined { if (!this.hasTexture) { // clear parameters if (this.polyface.data.param) { this.polyface.data.param.clear(); } if (this.polyface.data.paramIndex) { this.polyface.data.paramIndex = []; } } assert(this.transform.isIdentity); return new PolyfacePrimitiveList(PolyfacePrimitive.create(this.displayParams, this.polyface)); }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
MethodDeclaration
protected _getStrokes(_facetOptions: StrokeOptions): StrokesPrimitiveList | undefined { return undefined; }
naveedkhan8067/imodeljs
core/frontend/src/render/primitives/geometry/GeometryPrimitives.ts
TypeScript
InterfaceDeclaration
export interface GroupByExecutable extends TestGrouping { label?: string; description?: string; }
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
InterfaceDeclaration
export interface GroupBySource extends TestGrouping { label?: string; description?: string; groupUngroupedTo?: string; }
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
InterfaceDeclaration
export interface GroupByTags extends TestGrouping { tags?: string[][]; label?: string; // ${tags} will by substituted description?: string; groupUngroupedTo?: string; }
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
InterfaceDeclaration
export interface GroupByTagRegex extends TestGrouping { regexes?: string[]; label?: string; // ${match}, ${match_lowercased}, ${match_upperfirst} will by substituted description?: string; groupUngroupedTo?: string; }
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
InterfaceDeclaration
/// export interface TestGrouping { groupByExecutable?: GroupByExecutable; groupBySource?: GroupBySource; groupByTags?: GroupByTags; groupByTagRegex?: GroupByTagRegex; groupByRegex?: GroupByRegex; tagFormat?: string; // use "[${tag}]" }
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
TypeAliasDeclaration
export type GroupByRegex = GroupByTagRegex;
matepek/vscode-catch2-test-adapter
src/TestGroupingInterface.ts
TypeScript
InterfaceDeclaration
export interface SimulantFactory<S extends SimulantsLookup> { readonly isSimulantFactory: true; create<K extends string & keyof S>( ammo: typeof Ammo, dynamicsWorld: Ammo.btDiscreteDynamicsWorld, userDataRegistry: UserDataRegistry, request: MessageSimulantRegister<S, K> ): S[K]; }
mcharytoniuk/personalidol
packages/dynamics/src/SimulantFactory.interface.ts
TypeScript
ArrowFunction
Releve => { this.Releve = Releve; }
fabiencheylac/windsuptest
src/pages/releve/releve.ts
TypeScript
ClassDeclaration
/** * Generated class for the Releve page. * * See http://ionicframework.com/docs/components/#navigation for more info * on Ionic pages and navigation. */ @Component({ selector: 'page-Releve', templateUrl: 'Releve.html', providers: [ApiServiceReleve] }) export class RelevePage { Releve: Releve[]; constructor(public navCtrl: NavController, public apiReleve: ApiServiceReleve) { apiReleve.load().subscribe(Releve => { this.Releve = Releve; }); } }
fabiencheylac/windsuptest
src/pages/releve/releve.ts
TypeScript
MethodDeclaration
getValue(inst: Input) { return inst.props.value; }
ArkadiyVoronov/retail-ui
packages/retail-ui/components/Input/Input.adapter.ts
TypeScript
MethodDeclaration
setValue(inst: Input, value: string) { // tslint:disable-next-line:no-string-literal inst['handleChange']({ target: { value } } as ChangeEvent<HTMLInputElement>); }
ArkadiyVoronov/retail-ui
packages/retail-ui/components/Input/Input.adapter.ts
TypeScript
ArrowFunction
(documents: IDocument[]): SetAllDocuments => ({ type: SET_ALL_DOCUMENTS, documents, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(value: boolean): SetDocumentLoading => ({ type: SET_DOCUMENT_LOADING, value, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(): NextDocument => ({ type: NEXT_DOCUMENT })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(): PreviousDocument => ({ type: PREVIOUS_DOCUMENT, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
( document: IDocument ): UpdateCurrentDocument => ({ type: UPDATE_CURRENT_DOCUMENT, document })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(rect: DOMRect): SetRendererRect => ({ type: SET_RENDERER_RECT, rect, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(config: IConfig): SetMainConfig => ({ type: SET_MAIN_CONFIG, config, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
ArrowFunction
(index: number) => ({ type: SET_CURRENT_DOCUMENT, index, })
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface SetAllDocuments { type: typeof SET_ALL_DOCUMENTS; documents: IDocument[]; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface SetDocumentLoading { type: typeof SET_DOCUMENT_LOADING; value: boolean; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface NextDocument { type: typeof NEXT_DOCUMENT; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface PreviousDocument { type: typeof PREVIOUS_DOCUMENT; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface UpdateCurrentDocument { type: typeof UPDATE_CURRENT_DOCUMENT; document: IDocument; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface SetRendererRect { type: typeof SET_RENDERER_RECT; rect: DOMRect; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface SetMainConfig { type: typeof SET_MAIN_CONFIG; config: IConfig; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
InterfaceDeclaration
export interface SetCurrentDocument { type: typeof SET_CURRENT_DOCUMENT; index: number; }
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript