UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

1 lines 1.92 kB
{"version":3,"file":"uid.mjs","sources":["../../../src/utils/data/uid.ts"],"sourcesContent":["const uidCache: Record<string, number> = {\n default: -1,\n};\n\n/**\n * The names of the unique identifiers. These are used to create unique identifiers for different types of objects.\n * @category utils\n * @internal\n */\nexport type UIDNames =\n | 'default'\n | 'resource'\n | 'texture'\n | 'textureSource'\n | 'textureResource'\n | 'batcher' //\n | 'graphicsContext' //\n | 'graphicsView' //\n | 'graphicsPath' //\n | 'fillGradient' //\n | 'fillPattern' //\n | 'meshView' //\n | 'renderable' //\n | 'buffer' //\n | 'bufferResource' //\n | 'geometry'\n | 'instructionSet' //\n | 'renderTarget' //\n | 'uniform' //\n | 'spriteView' //\n | 'textView' //\n | 'tilingSpriteView' //\n | 'shader' //\n | 'renderer';\n\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @returns {number} The next unique identifier to use.\n * @category utils\n * @internal\n */\nexport function uid(name: UIDNames = 'default'): number\n{\n if (uidCache[name] === undefined)\n {\n uidCache[name] = -1;\n }\n\n return ++uidCache[name];\n}\n\n/**\n * Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :)\n * @internal\n */\nexport function resetUids(): void\n{\n for (const key in uidCache)\n {\n delete uidCache[key];\n }\n}\n"],"names":[],"mappings":";AAAA,MAAM,QAAmC,GAAA;AAAA,EACrC,OAAS,EAAA,CAAA,CAAA;AACb,CAAA,CAAA;AAwCgB,SAAA,GAAA,CAAI,OAAiB,SACrC,EAAA;AACI,EAAI,IAAA,QAAA,CAAS,IAAI,CAAA,KAAM,KACvB,CAAA,EAAA;AACI,IAAA,QAAA,CAAS,IAAI,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,GACrB;AAEA,EAAO,OAAA,EAAE,SAAS,IAAI,CAAA,CAAA;AAC1B,CAAA;AAMO,SAAS,SAChB,GAAA;AACI,EAAA,KAAA,MAAW,OAAO,QAClB,EAAA;AACI,IAAA,OAAO,SAAS,GAAG,CAAA,CAAA;AAAA,GACvB;AACJ;;;;"}