{"version":3,"file":"uid.mjs","sources":["../../../src/utils/data/uid.ts"],"sourcesContent":["const uidCache: Record = {\n default: -1,\n};\n\ntype 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\n/**\n * Gets the next unique identifier\n * @param name - The name of the identifier.\n * @function uid\n * @returns {number} The next unique identifier to use.\n * @memberof utils\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/** Resets the next unique identifier to 0. This is used for some tests, dont touch or things WILL explode :) */\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;AAiCgB,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;AAGO,SAAS,SAChB,GAAA;AACI,EAAA,KAAA,MAAW,OAAO,QAClB,EAAA;AACI,IAAA,OAAO,SAAS,GAAG,CAAA,CAAA;AAAA,GACvB;AACJ;;;;"}