repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/logging/logScene.ts | src/utils/logging/logScene.ts | /* eslint-disable no-console */
import { Sprite } from '../../scene/sprite/Sprite';
import type { Container } from '../../scene/container/Container';
import type { RenderGroup } from '../../scene/container/RenderGroup';
const colors = [
'#000080', // Navy Blue
'#228B22', // Forest Green
'#8B0000', // Dar... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/canvas/getCanvasBoundingBox.ts | src/utils/canvas/getCanvasBoundingBox.ts | import { DOMAdapter } from '../../environment/adapter';
import { nextPow2 } from '../../maths/misc/pow2';
import { Rectangle } from '../../maths/shapes/Rectangle';
import type { ICanvas } from '../../environment/canvas/ICanvas';
import type { ICanvasRenderingContext2D } from '../../environment/canvas/ICanvasRenderingC... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/__tests__/utils.test.ts | src/utils/__tests__/utils.test.ts | import earcut from 'earcut';
import { isMobile } from '../browser/isMobile';
import { isWebGLSupported } from '../browser/isWebGLSupported';
import { EventEmitter } from '../const';
import { removeItems } from '../data/removeItems';
import { uid } from '../data/uid';
import { getResolutionOfUrl } from '../network/getRe... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/__tests__/detectVideoAlphaMode.test.ts | src/utils/__tests__/detectVideoAlphaMode.test.ts | import { detectVideoAlphaMode } from '../browser/detectVideoAlphaMode';
import { getWebGLRenderer } from '@test-utils';
import { RenderTexture, Texture, VideoSource } from '~/rendering';
import { Container, Sprite } from '~/scene';
import type { WebGLRenderer } from '~/rendering';
describe('detectVideoAlphaMode', () ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/__tests__/getCanvasBoundingBox.test.ts | src/utils/__tests__/getCanvasBoundingBox.test.ts | import { getCanvasBoundingBox } from '../canvas/getCanvasBoundingBox';
describe('getCanvasBoundingBox', () =>
{
it('should get empty bounding box with empty canvas', () =>
{
const canvas = document.createElement('canvas');
canvas.width = 100;
canvas.height = 50;
const bounding... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/__tests__/path.test.ts | src/utils/__tests__/path.test.ts | import { path } from '../path';
describe('Paths', () =>
{
it('should convert paths to posix', () =>
{
expect(path.toPosix('C:\\foo\\bar')).toBe('C:/foo/bar');
expect(path.toPosix('C:\\foo\\bar/')).toBe('C:/foo/bar/');
expect(path.toPosix('C:\\foo/bar')).toBe('C:/foo/bar');
expe... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/__tests__/updateQuadBounds.test.ts | src/utils/__tests__/updateQuadBounds.test.ts | import { updateQuadBounds } from '../data/updateQuadBounds';
import { type ObservablePoint } from '~/maths';
import { type Texture } from '~/rendering';
describe('updateQuadBounds', () =>
{
let bounds: { minX: number; maxX: number; minY: number; maxY: number };
let anchor: ObservablePoint;
let texture: Tex... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/network/getResolutionOfUrl.ts | src/utils/network/getResolutionOfUrl.ts | import { Resolver } from '../../assets/resolver/Resolver';
/**
* get the resolution / device pixel ratio of an asset by looking for the prefix
* used by spritesheets and image urls
* @category utils
* @internal
* @param {string} url - the image path
* @param {number} [defaultValue=1] - the defaultValue if no fil... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/updateQuadBounds.ts | src/utils/data/updateQuadBounds.ts | import type { ObservablePoint } from '../../maths/point/ObservablePoint';
import type { Texture } from '../../rendering/renderers/shared/texture/Texture';
import type { BoundsData } from '../../scene/container/bounds/Bounds';
/**
* Updates the bounds of a quad (a rectangular area) based on the provided texture and an... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/ViewableBuffer.ts | src/utils/data/ViewableBuffer.ts | import { type TypedArray } from '../../rendering/renderers/shared/buffer/Buffer';
/**
* Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.
* @category utils
* @advanced
*/
export class ViewableBuffer
{
/** The size of the buffer in bytes. */
public size: number;
/** ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/removeItems.ts | src/utils/data/removeItems.ts | /**
* Remove items from a javascript array without generating garbage
* @function removeItems
* @category utils
* @internal
* @param {Array<any>} arr - Array to remove elements from
* @param {number} startIdx - starting index
* @param {number} removeCount - how many to remove
*/
export function removeItems(arr:... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/GCManagedHash.ts | src/utils/data/GCManagedHash.ts | import { type GCable, type GCData } from '../../rendering/renderers/shared/GCSystem';
import { type Renderer } from '../../rendering/renderers/types';
import type EventEmitter from 'eventemitter3';
/**
* Options for the {@link GCManagedHash}.
* @internal
*/
export interface GCManagedHashOptions<T extends GCable & ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/uid.ts | src/utils/data/uid.ts | const uidCache: Record<string, number> = {
default: -1,
};
/**
* The names of the unique identifiers. These are used to create unique identifiers for different types of objects.
* @category utils
* @internal
*/
export type UIDNames =
| 'default'
| 'resource'
| 'texture'
| 'textureSource'
| ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/data/clean.ts | src/utils/data/clean.ts | /**
* Takes a hash and removes all the `undefined`/`null` values from it.
* In PixiJS, we tend to null properties instead of using 'delete' for performance reasons.
* However, in some cases, this could be a problem if the hash grows too large over time,
* this function can be used to clean a hash.
* @param hash - ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/isMobile.ts | src/utils/browser/isMobile.ts | import isMobileJs from 'ismobilejs';
// ismobilejs have different import behavior for CJS and ESM, so here is the hack
type isMobileJsType = typeof isMobileJs & { default?: typeof isMobileJs };
const isMobileCall = (isMobileJs as isMobileJsType).default ?? isMobileJs;
/**
* The result of the mobile device detection ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/isSafari.ts | src/utils/browser/isSafari.ts | import { DOMAdapter } from '../../environment/adapter';
/**
* Checks if the current browser is Safari.
* @returns {boolean} True if the browser is Safari, false otherwise.
* @internal
*/
export function isSafari(): boolean
{
const { userAgent } = DOMAdapter.get().getNavigator();
return (/^((?!chrome|andro... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/isWebGLSupported.ts | src/utils/browser/isWebGLSupported.ts | import { DOMAdapter } from '../../environment/adapter';
import { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer';
let _isWebGLSupported: boolean | undefined;
/**
* Helper for checking for WebGL support in the current environment.
*
* Results are cached after first call for better... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/unsafeEvalSupported.ts | src/utils/browser/unsafeEvalSupported.ts | // Cache the result to prevent running this over and over
let unsafeEval: boolean;
/**
* Not all platforms allow to generate function code (e.g., `new Function`).
* this provides the platform-level detection.
* @private
* @returns {boolean} `true` if `new Function` is supported.
*/
export function unsafeEvalSuppo... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/detectVideoAlphaMode.ts | src/utils/browser/detectVideoAlphaMode.ts | /* eslint-disable no-restricted-globals */
import { DOMAdapter } from '../../environment/adapter';
import type { ALPHA_MODES } from '../../rendering/renderers/shared/texture/const';
let promise: Promise<ALPHA_MODES> | undefined;
/**
* Helper for detecting the correct alpha mode for video textures.
* For some reaso... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/utils/browser/isWebGPUSupported.ts | src/utils/browser/isWebGPUSupported.ts | import { DOMAdapter } from '../../environment/adapter';
let _isWebGPUSupported: boolean | undefined;
/**
* Helper for checking for WebGPU support in the current environment.
* Results are cached after first call for better performance.
* @example
* ```ts
* // Basic WebGPU support check
* const hasWebGPU = await... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/index.ts | src/compressed-textures/index.ts | // Auto-generated code, do not edit manually
export * from './basis/detectBasis';
export * from './basis/loadBasis';
export * from './basis/types';
export * from './basis/utils/createLevelBuffers';
export * from './basis/utils/gpuFormatToBasisTranscoderFormat';
export * from './basis/utils/setBasisTranscoderPath';
expo... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/const.ts | src/compressed-textures/ktx2/const.ts | import type { TEXTURE_FORMATS } from '../../rendering/renderers/shared/texture/const';
/** @internal */
export enum GL_INTERNAL_FORMAT
{
RGBA8_SNORM = 0x8F97,
RGBA = 0x1908,
RGBA8UI = 0x8D7C,
SRGB8_ALPHA8 = 0x8C43,
RGBA8I = 0x8D8E,
RGBA8 = 0x8058,
COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0,
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/loadKTX2.ts | src/compressed-textures/ktx2/loadKTX2.ts | import { LoaderParserPriority } from '../../assets/loader/parsers/LoaderParser';
import { createTexture } from '../../assets/loader/parsers/textures/utils/createTexture';
import { checkExtension } from '../../assets/utils/checkExtension';
import { ExtensionType } from '../../extensions/Extensions';
import { CompressedS... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/init.ts | src/compressed-textures/ktx2/init.ts | import { extensions } from '../../extensions/Extensions';
import { detectCompressed } from '../shared/detectCompressed';
import { resolveCompressedTextureUrl } from '../shared/resolveCompressedTextureUrl';
import { loadKTX2 } from './loadKTX2';
extensions.add(loadKTX2);
extensions.add(resolveCompressedTextureUrl);
ext... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/types.ts | src/compressed-textures/ktx2/types.ts | import type { TEXTURE_FORMATS } from '../../rendering/renderers/shared/texture/const';
/** @internal */
export type LIBKTXModuleCreator = (config: {
locateFile: (file: string) => string
}) => {
then: (result: (libktx: LIBKTXModule) => void) => void
};
/** @internal */
export interface KTXTexture
{
getImag... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/worker/ktx.worker.ts | src/compressed-textures/ktx2/worker/ktx.worker.ts | import { convertFormatIfRequired } from '../utils/convertFormatIfRequired';
import { createLevelBuffersFromKTX } from '../utils/createLevelBuffersFromKTX';
import { getTextureFormatFromKTXTexture } from '../utils/getTextureFormatFromKTXTexture';
import { gpuFormatToKTXBasisTranscoderFormat } from '../utils/gpuFormatToK... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/worker/loadKTX2onWorker.ts | src/compressed-textures/ktx2/worker/loadKTX2onWorker.ts | import KTXWorker from 'worker:./ktx.worker.ts';
import { ktxTranscoderUrls } from '../utils/setKTXTranscoderPath';
import type { TEXTURE_FORMATS } from '../../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../../rendering/renderers/shared/texture/sources/TextureSource';
le... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/createLevelBuffersFromKTX.ts | src/compressed-textures/ktx2/utils/createLevelBuffersFromKTX.ts | import type { KTXTexture } from '../types';
/**
* @param ktxTexture
* @internal
*/
export function createLevelBuffersFromKTX(ktxTexture: KTXTexture): Uint8Array[]
{
const levelBuffers = [];
// create the levels..
for (let i = 0; i < ktxTexture.numLevels; i++)
{
const imageData = ktxTexture.... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/glFormatToGPUFormat.ts | src/compressed-textures/ktx2/utils/glFormatToGPUFormat.ts | import type { COMPRESSED_TEXTURE_FORMATS } from '../types';
const glFormatToGPUFormatMap: Record<number, COMPRESSED_TEXTURE_FORMATS> = {
6408: 'rgba8unorm',
32856: 'bgra8unorm', //
32857: 'rgb10a2unorm',
33189: 'depth16unorm',
33190: 'depth24plus',
33321: 'r8unorm',
33323: 'rg8unorm',
3... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/vkFormatToGPUFormat.ts | src/compressed-textures/ktx2/utils/vkFormatToGPUFormat.ts | import type { COMPRESSED_TEXTURE_FORMATS } from '../types';
const vkFormatToGPUFormatMap: Record<number, COMPRESSED_TEXTURE_FORMATS> = {
23: 'rgb8unorm', // VK_FORMAT_R8G8B8_UNORM
37: 'rgba8unorm', // VK_FORMAT_R8G8B8A8_UNORM
43: 'rgba8unorm-srgb', // VK_FORMAT_R8G8B8A8_SRGB
// TODO add more!
};
/**
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/convertFormatIfRequired.ts | src/compressed-textures/ktx2/utils/convertFormatIfRequired.ts | import type { TEXTURE_FORMATS } from '../../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../../rendering/renderers/shared/texture/sources/TextureSource';
interface ColorConverter
{
convertedFormat: TEXTURE_FORMATS,
convertFunction: (levelBuffer: Uint8Array) => Uin... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/getTextureFormatFromKTXTexture.ts | src/compressed-textures/ktx2/utils/getTextureFormatFromKTXTexture.ts | import { glFormatToGPUFormat } from './glFormatToGPUFormat';
import { vkFormatToGPUFormat } from './vkFormatToGPUFormat';
import type { COMPRESSED_TEXTURE_FORMATS, KTXTexture } from '../types';
/**
* @param ktxTexture
* @internal
*/
export function getTextureFormatFromKTXTexture(ktxTexture: KTXTexture): COMPRESSED... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/gpuFormatToKTXBasisTranscoderFormat.ts | src/compressed-textures/ktx2/utils/gpuFormatToKTXBasisTranscoderFormat.ts | const gpuFormatToBasisTranscoderFormatMap: Record<string, string> = {
'bc3-rgba-unorm': 'BC3_RGBA',
'bc7-rgba-unorm': 'BC7_M5_RGBA',
'etc2-rgba8unorm': 'ETC2_RGBA',
'astc-4x4-unorm': 'ASTC_4x4_RGBA',
// Uncompressed
rgba8unorm: 'RGBA32',
rg11b10ufloat: 'R11F_G11F_B10F',
};
/**
* @param tra... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx2/utils/setKTXTranscoderPath.ts | src/compressed-textures/ktx2/utils/setKTXTranscoderPath.ts | /**
* The urls for the KTX transcoder library.
* These can be set to custom paths if needed.
* @category assets
* @advanced
*/
export const ktxTranscoderUrls = {
jsUrl: 'https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.js',
wasmUrl: 'https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.wa... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/dds/loadDDS.ts | src/compressed-textures/dds/loadDDS.ts | import { LoaderParserPriority } from '../../assets/loader/parsers/LoaderParser';
import { createTexture } from '../../assets/loader/parsers/textures/utils/createTexture';
import { checkExtension } from '../../assets/utils/checkExtension';
import { ExtensionType } from '../../extensions/Extensions';
import { CompressedS... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/dds/const.ts | src/compressed-textures/dds/const.ts | import type { TEXTURE_FORMATS } from '../../rendering/renderers/shared/texture/const';
// http://msdn.microsoft.com/en-us/library/bb943991.aspx/
/**
* DWORD offsets of the DDS file header fields (relative to file start).
* @ignore
*/
const DDS_HEADER_FIELDS = {
MAGIC: 0,
SIZE: 1,
FLAGS: 2,
HEIGHT: 3... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/dds/init.ts | src/compressed-textures/dds/init.ts | import { extensions } from '../../extensions/Extensions';
import { detectCompressed } from '../shared/detectCompressed';
import { resolveCompressedTextureUrl } from '../shared/resolveCompressedTextureUrl';
import { loadDDS } from './loadDDS';
extensions.add(loadDDS, detectCompressed, resolveCompressedTextureUrl);
| typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/dds/parseDDS.ts | src/compressed-textures/dds/parseDDS.ts | import { DDS, DXGI_TO_TEXTURE_FORMAT, FOURCC_TO_TEXTURE_FORMAT, TEXTURE_FORMAT_BLOCK_SIZE } from './const';
import type { TEXTURE_FORMATS } from '../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../rendering/renderers/shared/texture/sources/TextureSource';
/**
* @param a... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx/parseKTX.ts | src/compressed-textures/ktx/parseKTX.ts | import { KTX } from '../ktx2/const';
import type { TEXTURE_FORMATS } from '../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../rendering/renderers/shared/texture/sources/TextureSource';
/**
* @param arrayBuffer
* @param supportedFormats
* @internal
*/
export function ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx/init.ts | src/compressed-textures/ktx/init.ts | import { extensions } from '../../extensions/Extensions';
import { detectCompressed } from '../shared/detectCompressed';
import { resolveCompressedTextureUrl } from '../shared/resolveCompressedTextureUrl';
import { loadKTX } from './loadKTX';
extensions.add(loadKTX);
extensions.add(resolveCompressedTextureUrl);
extens... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/ktx/loadKTX.ts | src/compressed-textures/ktx/loadKTX.ts | import { LoaderParserPriority } from '../../assets/loader/parsers/LoaderParser';
import { createTexture } from '../../assets/loader/parsers/textures/utils/createTexture';
import { checkExtension } from '../../assets/utils/checkExtension';
import { ExtensionType } from '../../extensions/Extensions';
import { CompressedS... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/loadBasis.ts | src/compressed-textures/basis/loadBasis.ts | import { LoaderParserPriority } from '../../assets/loader/parsers/LoaderParser';
import { createTexture } from '../../assets/loader/parsers/textures/utils/createTexture';
import { checkExtension } from '../../assets/utils/checkExtension';
import { ExtensionType } from '../../extensions/Extensions';
import { CompressedS... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/init.ts | src/compressed-textures/basis/init.ts | import { extensions } from '../../extensions/Extensions';
import { detectBasis } from './detectBasis';
import { loadBasis } from './loadBasis';
extensions.add(loadBasis, detectBasis);
| typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/detectBasis.ts | src/compressed-textures/basis/detectBasis.ts | import { ExtensionType } from '../../extensions/Extensions';
import { isWebGLSupported } from '../../utils/browser/isWebGLSupported';
import { isWebGPUSupported } from '../../utils/browser/isWebGPUSupported';
import type { FormatDetectionParser } from '../../assets/detections/types';
/**
* Detects if Basis textures ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/types.ts | src/compressed-textures/basis/types.ts | /** @internal */
export type BASISModuleCreator = (config: {
locateFile: (file: string) => string
}) => {
then: (result: (libktx: BASISModule) => void) => void
};
/** @internal */
export type BasisTextureConstructor = new (data: Uint8Array) => BasisTexture;
/** @internal */
export interface BASISModule
{
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/worker/basis.worker.ts | src/compressed-textures/basis/worker/basis.worker.ts | import { createLevelBuffers } from '../utils/createLevelBuffers';
import { gpuFormatToBasisTranscoderFormat } from '../utils/gpuFormatToBasisTranscoderFormat';
import type { TEXTURE_FORMATS } from '../../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../../rendering/rendere... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/worker/loadBasisOnWorker.ts | src/compressed-textures/basis/worker/loadBasisOnWorker.ts | import BasisWorker from 'worker:./basis.worker.ts';
import { basisTranscoderUrls } from '../utils/setBasisTranscoderPath';
import type { TEXTURE_FORMATS } from '../../../rendering/renderers/shared/texture/const';
import type { TextureSourceOptions } from '../../../rendering/renderers/shared/texture/sources/TextureSour... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/utils/gpuFormatToBasisTranscoderFormat.ts | src/compressed-textures/basis/utils/gpuFormatToBasisTranscoderFormat.ts | const gpuFormatToBasisTranscoderFormatMap: Record<string, number> = {
'bc3-rgba-unorm': 3, // cTFBC3_RGBA
'bc7-rgba-unorm': 6, // cTFBC7_RGBA,
'etc2-rgba8unorm': 1, // cTFETC2_RGBA,
'astc-4x4-unorm': 10, // cTFASTC_4x4_RGBA,
// Uncompressed
rgba8unorm: 13, // cTFRGBA32,
rgba4unorm: 16, // cT... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/utils/createLevelBuffers.ts | src/compressed-textures/basis/utils/createLevelBuffers.ts | import type { BasisTexture } from '../types';
/**
* @param basisTexture
* @param basisTranscoderFormat
* @internal
*/
export function createLevelBuffers(basisTexture: BasisTexture, basisTranscoderFormat: number): Uint8Array[]
{
const images = basisTexture.getNumImages();
const levels = basisTexture.getNumL... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/basis/utils/setBasisTranscoderPath.ts | src/compressed-textures/basis/utils/setBasisTranscoderPath.ts | /**
* The urls for the Basis transcoder files.
* These can be set to custom paths if needed.
* @category assets
* @advanced
*/
export const basisTranscoderUrls = {
jsUrl: 'https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.js',
wasmUrl: 'https://cdn.jsdelivr.net/npm/pixi.js/transcoders... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/__tests__/CompressedTextures.test.ts | src/compressed-textures/__tests__/CompressedTextures.test.ts | import { detectBasis } from '../basis/detectBasis';
import { loadDDS } from '../dds/loadDDS';
import { detectCompressed } from '../shared/detectCompressed';
import { resolveCompressedTextureUrl } from '../shared/resolveCompressedTextureUrl';
import { Assets, Loader, Resolver } from '~/assets';
import type { Texture } ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/__tests__/ParseKTX.test.ts | src/compressed-textures/__tests__/ParseKTX.test.ts | import { readFileSync } from 'fs-extra';
import path from 'path';
import { parseKTX } from '../ktx/parseKTX';
describe('Parse KTX', () =>
{
it('should throw Error Unsupported texture format', async () =>
{
const buffer = readFileSync(path.join(__dirname, 'textures/test.astc.4x4.ktx'));
const ar... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/__tests__/ParseDDS.test.ts | src/compressed-textures/__tests__/ParseDDS.test.ts | import { readFileSync } from 'fs-extra';
import path from 'path';
import { parseDDS } from '../dds/parseDDS';
describe('Parse DDS', () =>
{
it('should throw Error Unsupported texture format', async () =>
{
const buffer = readFileSync(path.resolve(__dirname, 'textures/test.dxt1.dds'));
const arr... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/shared/detectCompressed.ts | src/compressed-textures/shared/detectCompressed.ts | import { ExtensionType } from '../../extensions/Extensions';
// eslint-disable-next-line max-len
import { getSupportedCompressedTextureFormats } from '../../rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats';
import { isWebGLSupported } from '../../utils/browser/isWebGLSupported';
import { i... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/compressed-textures/shared/resolveCompressedTextureUrl.ts | src/compressed-textures/shared/resolveCompressedTextureUrl.ts | import { Resolver } from '../../assets/resolver/Resolver';
import { checkExtension } from '../../assets/utils/checkExtension';
import { ExtensionType } from '../../extensions/Extensions';
import type { ResolveURLParser } from '../../assets/resolver/types';
/** @internal */
export const validFormats = ['basis', 'bc7',... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/BackgroundLoader.ts | src/assets/BackgroundLoader.ts | import type { Loader } from './loader/Loader';
import type { ResolvedAsset } from './types';
/**
* The BackgroundLoader handles loading assets passively in the background to prepare them for future use.
* It loads one asset at a time to minimize impact on application performance.
*
* Key features:
* - Sequential ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/AssetExtension.ts | src/assets/AssetExtension.ts | import type { ExtensionType } from '../extensions/Extensions';
import type { CacheParser } from './cache/CacheParser';
import type { FormatDetectionParser } from './detections/types';
import type { LoaderParserAdvanced } from './loader/parsers/LoaderParser';
import type { ResolveURLParser } from './resolver/types';
/*... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/Assets.ts | src/assets/Assets.ts | /* eslint-disable max-len */
import { extensions, ExtensionType } from '../extensions/Extensions';
import { bitmapFontCachePlugin, loadBitmapFont } from '../scene/text-bitmap/asset/loadBitmapFont';
import { warn } from '../utils/logging/warn';
import { BackgroundLoader } from './BackgroundLoader';
import { Cache } from... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | true |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/types.ts | src/assets/types.ts | /**
* A utility type that allows a value to be either a single item of type T or an array of items of type T.
* @category utils
* @advanced
*/
export type ArrayOr<T> = T | T[];
/**
* @deprecated Use {@link AssetParser} instead.
* @category assets
* @advanced
*/
export type LoadParserName =
| 'loadJson'
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/index.ts | src/assets/index.ts | // Auto-generated code, do not edit manually
export * from './AssetExtension';
export * from './Assets';
export * from './BackgroundLoader';
export * from './cache/Cache';
export * from './cache/CacheParser';
export * from './cache/parsers/cacheTextureArray';
export * from './detections/parsers/detectAvif';
export * fr... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/AssetsMixins.d.ts | src/assets/AssetsMixins.d.ts | declare global
{
namespace PixiMixins
{
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface AssetsPreferences
{
}
}
}
export {};
| typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/Loader.ts | src/assets/loader/Loader.ts | import { warn } from '../../utils/logging/warn';
import { path } from '../../utils/path';
import { type ProgressCallback } from '../Assets';
import { convertToList } from '../utils/convertToList';
import { isSingleItem } from '../utils/isSingleItem';
import type { ResolvedAsset } from '../types';
import type { LoaderP... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/types.ts | src/assets/loader/types.ts | import type { LoaderParser } from './parsers/LoaderParser';
/**
* A promise and parser pair
* @category assets
* @advanced
*/
export interface PromiseAndParser
{
/** the promise that is loading the asset */
promise: Promise<any>
/** the parser that is loading the asset */
parser: LoaderParser
}
| typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/workers/loadImageBitmap.worker.ts | src/assets/loader/workers/loadImageBitmap.worker.ts | interface MessageData
{
data: any[];
uuid: number;
id: string;
}
async function loadImageBitmap(url: string, alphaMode?: string)
{
const response = await fetch(url);
if (!response.ok)
{
throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${respon... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/workers/checkImageBitmap.worker.ts | src/assets/loader/workers/checkImageBitmap.worker.ts | // 1x1 white PNG data URL
const WHITE_PNG
= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=';
async function checkImageBitmap()
{
try
{
if (typeof createImageBitmap !== 'function') return false;
const response = await fetc... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/workers/WorkerManager.ts | src/assets/loader/workers/WorkerManager.ts | import CheckImageBitmapWorker from 'worker:./checkImageBitmap.worker.ts';
import LoadImageBitmapWorker from 'worker:./loadImageBitmap.worker.ts';
import type { TextureSourceOptions } from '../../../rendering/renderers/shared/texture/sources/TextureSource';
import type { ResolvedAsset } from '../../types';
let UUID = ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/__tests__/Loader.test.ts | src/assets/loader/__tests__/Loader.test.ts | import { Cache } from '../../cache/Cache';
import { Loader } from '../Loader';
import { loadJson } from '../parsers/loadJson';
import { loadWebFont } from '../parsers/loadWebFont';
import { loadSvg } from '../parsers/textures/loadSVG';
import { loadTextures } from '../parsers/textures/loadTextures';
import { basePath }... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/loadJson.ts | src/assets/loader/parsers/loadJson.ts | import { DOMAdapter } from '../../../environment/adapter';
import { ExtensionType } from '../../../extensions/Extensions';
import { checkDataUrl } from '../../utils/checkDataUrl';
import { checkExtension } from '../../utils/checkExtension';
import { LoaderParserPriority } from './LoaderParser';
import type { LoaderPar... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/LoaderParser.ts | src/assets/loader/parsers/LoaderParser.ts | import type { ExtensionMetadata } from '../../../extensions/Extensions';
import type { ResolvedAsset } from '../../types';
import type { Loader } from '../Loader';
/**
* The extension priority for loader parsers.
* Helpful when managing multiple parsers that share the same extension test.
* The higher priority pars... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/loadWebFont.ts | src/assets/loader/parsers/loadWebFont.ts | import { DOMAdapter } from '../../../environment/adapter';
import { ExtensionType } from '../../../extensions/Extensions';
import { warn } from '../../../utils/logging/warn';
import { path } from '../../../utils/path';
import { Cache } from '../../cache/Cache';
import { checkDataUrl } from '../../utils/checkDataUrl';
i... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/loadTxt.ts | src/assets/loader/parsers/loadTxt.ts | import { DOMAdapter } from '../../../environment/adapter';
import { ExtensionType } from '../../../extensions/Extensions';
import { checkDataUrl } from '../../utils/checkDataUrl';
import { checkExtension } from '../../utils/checkExtension';
import { LoaderParserPriority } from './LoaderParser';
import type { LoaderPar... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/__tests__/loadWebFont.test.ts | src/assets/loader/parsers/__tests__/loadWebFont.test.ts | import { getFontFamilyName } from '../loadWebFont';
describe('loadWebFont', () =>
{
it('should get font family name', () =>
{
expect(getFontFamilyName('AbCdEf.ttf')).toBe('Abcdef');
expect(getFontFamilyName('ABC def-gHi_JkL.otf')).toBe('Abc Def Ghi Jkl');
expect(getFontFamilyName('ABC12... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/textures/loadTextures.ts | src/assets/loader/parsers/textures/loadTextures.ts | import { DOMAdapter } from '../../../../environment/adapter';
import { type ImageLike } from '../../../../environment/ImageLike';
import { ExtensionType } from '../../../../extensions/Extensions';
import { ImageSource } from '../../../../rendering/renderers/shared/texture/sources/ImageSource';
import { getResolutionOfU... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/textures/loadSVG.ts | src/assets/loader/parsers/textures/loadSVG.ts | import { DOMAdapter } from '../../../../environment/adapter';
import { type ImageLike } from '../../../../environment/ImageLike';
import { ExtensionType } from '../../../../extensions/Extensions';
import { ImageSource } from '../../../../rendering/renderers/shared/texture/sources/ImageSource';
import { GraphicsContext ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/textures/loadVideoTextures.ts | src/assets/loader/parsers/textures/loadVideoTextures.ts | /* eslint-disable no-restricted-globals */
import { type ImageLike } from '../../../../environment/ImageLike';
import { ExtensionType } from '../../../../extensions/Extensions';
import { VideoSource } from '../../../../rendering/renderers/shared/texture/sources/VideoSource';
import { detectVideoAlphaMode } from '../../... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/loader/parsers/textures/utils/createTexture.ts | src/assets/loader/parsers/textures/utils/createTexture.ts | import { Texture } from '../../../../../rendering/renderers/shared/texture/Texture';
import { warn } from '../../../../../utils/logging/warn';
import { Cache } from '../../../../cache/Cache';
import type { TextureSource } from '../../../../../rendering/renderers/shared/texture/sources/TextureSource';
import type { Loa... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/cache/CacheParser.ts | src/assets/cache/CacheParser.ts | import type { ExtensionMetadata } from '../../extensions/Extensions';
/**
* For every asset that is cached, it will call the parsers test function
* the flow is as follows:
*
* 1. `cacheParser.test()`: Test the asset.
* 2. `cacheParser.getCacheableAssets()`: If the test passes call the getCacheableAssets function... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/cache/Cache.ts | src/assets/cache/Cache.ts | import { warn } from '../../utils/logging/warn';
import { convertToList } from '../utils/convertToList';
import type { CacheParser } from './CacheParser';
/** @internal */
class CacheClass
{
private readonly _parsers: CacheParser[] = [];
private readonly _cache: Map<any, any> = new Map();
private readonl... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/cache/__tests__/Cache.test.ts | src/assets/cache/__tests__/Cache.test.ts | import { Cache } from '../Cache';
import type { CacheParser } from '../CacheParser';
const testParser = {
test: (asset: string) => typeof asset === 'string',
getCacheableAssets: (keys: string[], asset: string) =>
{
const out: Record<string, string> = {};
keys.forEach((key) =>
{
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/cache/parsers/cacheTextureArray.ts | src/assets/cache/parsers/cacheTextureArray.ts | import { ExtensionType } from '../../../extensions/Extensions';
import { Texture } from '../../../rendering/renderers/shared/texture/Texture';
import type { CacheParser } from '../CacheParser';
/**
* Returns an object of textures from an array of textures to be cached
* @category assets
* @internal
*/
export cons... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/isSingleItem.ts | src/assets/utils/isSingleItem.ts | /**
* Checks if the given value is an array.
* @param item - The item to test
* @internal
*/
export const isSingleItem = (item: unknown): boolean => (!Array.isArray(item));
| typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/createStringVariations.ts | src/assets/utils/createStringVariations.ts | function processX(base: string, ids: string[][], depth: number, result: string[], tags: string[])
{
const id = ids[depth];
for (let i = 0; i < id.length; i++)
{
const value = id[i];
if (depth < ids.length - 1)
{
processX(base.replace(result[depth], value), ids, depth + ... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/checkExtension.ts | src/assets/utils/checkExtension.ts | import { path } from '../../utils/path';
/**
* @param url
* @param extension
* @internal
*/
export function checkExtension(url: string, extension: string | string[]): boolean
{
const tempURL = url.split('?')[0];
const ext = path.extname(tempURL).toLowerCase();
if (Array.isArray(extension))
{
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/convertToList.ts | src/assets/utils/convertToList.ts | /**
* @param input
* @param transform
* @param forceTransform
* @internal
*/
export const convertToList = <T>(
input: string | T | (string | T)[],
transform?: (input: string) => T,
forceTransform = false
): T[] =>
{
if (!Array.isArray(input))
{
input = [input as T];
}
if (!tran... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/copySearchParams.ts | src/assets/utils/copySearchParams.ts | /**
* Copies the search params from one url to another
* @param targetUrl - the url to copy the search params to
* @param sourceUrl - the url container the search params we want to copy
* @returns the url with the search params copied
* @internal
*/
export const copySearchParams = (targetUrl: string, sourceUrl: s... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/checkDataUrl.ts | src/assets/utils/checkDataUrl.ts | /**
* @param url
* @param mimes
* @internal
*/
export function checkDataUrl(url: string, mimes: string | string[]): boolean
{
if (Array.isArray(mimes))
{
for (const mime of mimes)
{
if (url.startsWith(`data:${mime}`)) return true;
}
return false;
}
retur... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/utils/__tests__/createStringVariations.test.ts | src/assets/utils/__tests__/createStringVariations.test.ts | import { createStringVariations } from '../createStringVariations';
describe('createStringVariations', () =>
{
it('createStringVariations should parse correctly', () =>
{
const out = createStringVariations('hell@{2,1,0.5}x.{png,webp,avif}');
expect(out).toEqual([
'hell@2x.png',
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/loadVideo.test.ts | src/assets/__tests__/loadVideo.test.ts | import { Assets } from '../Assets';
import { basePath, getApp } from '@test-utils';
import { Texture } from '~/rendering';
describe('loadVideo', () =>
{
beforeAll(async () =>
{
jest.setTimeout(10000);
// we need the app loaded for these tests
await getApp();
});
beforeEach(() =... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/Assets.test.ts | src/assets/__tests__/Assets.test.ts | import { setTimeout } from 'timers/promises';
import '~/spritesheet/init';
import { Assets } from '../Assets';
import { basePath } from '@test-utils';
import { loadTextures } from '~/assets';
import { Texture } from '~/rendering';
describe('Assets', () =>
{
beforeEach(() =>
{
// reset the loader
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/unresolved.test.ts | src/assets/__tests__/unresolved.test.ts | import '~/spritesheet/init';
import { Assets } from '../Assets';
import { basePath, getApp } from '@test-utils';
import type { Texture } from '~/rendering';
describe('Assets Unresolved', () =>
{
beforeAll(async () =>
{
await getApp();
});
beforeEach(() =>
{
// reset the loader
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/bundle.test.ts | src/assets/__tests__/bundle.test.ts | import { setTimeout } from 'timers/promises';
import { Assets } from '../Assets';
import { basePath, getApp } from '@test-utils';
import { Texture } from '~/rendering';
import { Spritesheet } from '~/spritesheet';
import type { BundleIdentifierOptions } from '../resolver/Resolver';
describe('Assets bundles', () =>
{
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/loadSVG.test.ts | src/assets/__tests__/loadSVG.test.ts | import { Assets } from '../Assets';
import { basePath } from '@test-utils';
import { Texture } from '~/rendering';
describe('loadSVG decimal resolution fix', () =>
{
beforeEach(() =>
{
Assets.reset();
});
beforeAll(async () =>
{
await Assets.init({
basePath,
});... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/__tests__/detections.test.ts | src/assets/__tests__/detections.test.ts | import { Assets } from '../Assets';
import { detectAvif } from '../detections/parsers/detectAvif';
import { detectDefaults } from '../detections/parsers/detectDefaults';
import { detectMp4 } from '../detections/parsers/detectMp4';
import { detectOgv } from '../detections/parsers/detectOgv';
import { detectWebm } from '... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/Resolver.ts | src/assets/resolver/Resolver.ts | import { warn } from '../../utils/logging/warn';
import { path } from '../../utils/path';
import { convertToList } from '../utils/convertToList';
import { createStringVariations } from '../utils/createStringVariations';
import { isSingleItem } from '../utils/isSingleItem';
import type {
ArrayOr,
AssetsBundle,
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/types.ts | src/assets/resolver/types.ts | import type { ExtensionMetadata } from '../../extensions/Extensions';
import type { ResolvedAsset } from '../types';
/**
* A prefer order lets the resolver know which assets to prefer depending on the various parameters passed to it.
* @category assets
* @standard
*/
export interface PreferOrder
{
/** the impo... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/__tests__/Resolver.test.ts | src/assets/resolver/__tests__/Resolver.test.ts | import { Assets } from '../../Assets';
import { resolveJsonUrl } from '../parsers/resolveJsonUrl';
import { resolveTextureUrl } from '../parsers/resolveTextureUrl';
import { getUrlExtension, Resolver } from '../Resolver';
import { manifest } from './sampleManifest';
import { extensions, ExtensionType } from '~/extensio... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/__tests__/sampleManifest.ts | src/assets/resolver/__tests__/sampleManifest.ts | import type { AssetsManifest } from '../../types';
/** @internal */
export const manifest: AssetsManifest = {
bundles: [
{
name: 'default',
assets: [
{
alias: 'image1',
src: [
{
... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/parsers/resolveJsonUrl.ts | src/assets/resolver/parsers/resolveJsonUrl.ts | import { ExtensionType } from '../../../extensions/Extensions';
import { Resolver } from '../Resolver';
import { resolveTextureUrl } from './resolveTextureUrl';
import type { ResolveURLParser } from '../types';
/**
* A parser that will resolve a json urls resolution for spritesheets
* e.g. `assets/spritesheet@1x.js... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/resolver/parsers/resolveTextureUrl.ts | src/assets/resolver/parsers/resolveTextureUrl.ts | import { ExtensionType } from '../../../extensions/Extensions';
import { loadTextures } from '../../loader/parsers/textures/loadTextures';
import { Resolver } from '../Resolver';
import type { ResolveURLParser } from '../types';
/**
* A parser that will resolve a texture url
* @category assets
* @internal
*/
expo... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
pixijs/pixijs | https://github.com/pixijs/pixijs/blob/98ea728fc887ea93a1131a61cac66ab4fc45eebe/src/assets/detections/types.ts | src/assets/detections/types.ts | import type { ExtensionMetadata } from '../../extensions/Extensions';
/**
* Format detection is useful for detecting feature support on the current platform.
* @category assets
* @advanced
*/
export interface FormatDetectionParser
{
/** Should be ExtensionType.DetectionParser */
extension?: ExtensionMetada... | typescript | MIT | 98ea728fc887ea93a1131a61cac66ab4fc45eebe | 2026-01-04T15:41:01.429164Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.