This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

83
node_modules/pixi.js/lib/environment/adapter.d.ts generated vendored Normal file
View File

@@ -0,0 +1,83 @@
/// <reference types="@webgpu/types" />
import type { ICanvas } from './canvas/ICanvas';
import type { ICanvasRenderingContext2D } from './canvas/ICanvasRenderingContext2D';
/**
* PixiJS supports multiple environments including browsers, Web Workers, and Node.js.
* The environment is auto-detected by default using the {@link environment.autoDetectEnvironment} function.
*
* The {@link environment.Adapter} interface provides a way to abstract away the differences between
* these environments. PixiJS uses the {@link environment.BrowserAdapter} by default.
*
* However you can manually set the environment using the {@link environment.DOMAdapter} singleton, for example to
* use Pixi within a WebWorker.
* ```js
* import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';
*
* // WebWorkerAdapter is an implementation of the Adapter interface
* DOMAdapter.set(WebWorkerAdapter);
*
* // use the adapter to create a canvas (in this case an OffscreenCanvas)
* DOMAdapter.get().createCanvas(800, 600);
* ```
* @namespace environment
*/
/**
* This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.
* Implementations of this interface can be used to make sure Pixi will work in any environment,
* such as browser, Web Workers, and Node.js.
* @memberof environment
*/
export interface Adapter {
/** Returns a canvas object that can be used to create a webgl context. */
createCanvas: (width?: number, height?: number) => ICanvas;
/** Returns a 2D rendering context. */
getCanvasRenderingContext2D: () => {
prototype: ICanvasRenderingContext2D;
};
/** Returns a WebGL rendering context. */
getWebGLRenderingContext: () => typeof WebGLRenderingContext;
/** Returns a partial implementation of the browsers window.navigator */
getNavigator: () => {
userAgent: string;
gpu: GPU | null;
};
/** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */
getBaseUrl: () => string;
/** Return the font face set if available */
getFontFaceSet: () => FontFaceSet | null;
/** Returns a Response object that has been fetched from the given URL. */
fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;
/** Returns Document object that has been parsed from the given XML string. */
parseXML: (xml: string) => Document;
}
/**
* The DOMAdapter is a singleton that allows PixiJS to perform DOM operations, such as creating a canvas.
* This allows PixiJS to be used in any environment, such as a web browser, Web Worker, or Node.js.
* It uses the {@link environment.Adapter} interface to abstract away the differences between these environments
* and uses the {@link environment.BrowserAdapter} by default.
*
* It has two methods: `get():Adapter` and `set(adapter: Adapter)`.
*
* Defaults to the {@link environment.BrowserAdapter}.
* @example
* import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';
*
* // WebWorkerAdapter is an implementation of the Adapter interface
* DOMAdapter.set(WebWorkerAdapter);
*
* // use the adapter to create a canvas (in this case an OffscreenCanvas)
* DOMAdapter.get().createCanvas(800, 600);
* @memberof environment
*/
export declare const DOMAdapter: {
/**
* Returns the current adapter.
* @returns {environment.Adapter} The current adapter.
*/
get(): Adapter;
/**
* Sets the current adapter.
* @param adapter - The new adapter.
*/
set(adapter: Adapter): void;
};

25
node_modules/pixi.js/lib/environment/adapter.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict';
var BrowserAdapter = require('../environment-browser/BrowserAdapter.js');
"use strict";
let currentAdapter = BrowserAdapter.BrowserAdapter;
const DOMAdapter = {
/**
* Returns the current adapter.
* @returns {environment.Adapter} The current adapter.
*/
get() {
return currentAdapter;
},
/**
* Sets the current adapter.
* @param adapter - The new adapter.
*/
set(adapter) {
currentAdapter = adapter;
}
};
exports.DOMAdapter = DOMAdapter;
//# sourceMappingURL=adapter.js.map

1
node_modules/pixi.js/lib/environment/adapter.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"adapter.js","sources":["../../src/environment/adapter.ts"],"sourcesContent":["import { BrowserAdapter } from '../environment-browser/BrowserAdapter';\n\nimport type { ICanvas } from './canvas/ICanvas';\nimport type { ICanvasRenderingContext2D } from './canvas/ICanvasRenderingContext2D';\n\n/**\n * PixiJS supports multiple environments including browsers, Web Workers, and Node.js.\n * The environment is auto-detected by default using the {@link environment.autoDetectEnvironment} function.\n *\n * The {@link environment.Adapter} interface provides a way to abstract away the differences between\n * these environments. PixiJS uses the {@link environment.BrowserAdapter} by default.\n *\n * However you can manually set the environment using the {@link environment.DOMAdapter} singleton, for example to\n * use Pixi within a WebWorker.\n * ```js\n * import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';\n *\n * // WebWorkerAdapter is an implementation of the Adapter interface\n * DOMAdapter.set(WebWorkerAdapter);\n *\n * // use the adapter to create a canvas (in this case an OffscreenCanvas)\n * DOMAdapter.get().createCanvas(800, 600);\n * ```\n * @namespace environment\n */\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.\n * Implementations of this interface can be used to make sure Pixi will work in any environment,\n * such as browser, Web Workers, and Node.js.\n * @memberof environment\n */\nexport interface Adapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => ICanvas;\n /** Returns a 2D rendering context. */\n getCanvasRenderingContext2D: () => { prototype: ICanvasRenderingContext2D; };\n /** Returns a WebGL rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string, gpu: GPU | null };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n /** Return the font face set if available */\n getFontFaceSet: () => FontFaceSet | null;\n /** Returns a Response object that has been fetched from the given URL. */\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n /** Returns Document object that has been parsed from the given XML string. */\n parseXML: (xml: string) => Document;\n}\n\nlet currentAdapter: Adapter = BrowserAdapter;\n\n/**\n * The DOMAdapter is a singleton that allows PixiJS to perform DOM operations, such as creating a canvas.\n * This allows PixiJS to be used in any environment, such as a web browser, Web Worker, or Node.js.\n * It uses the {@link environment.Adapter} interface to abstract away the differences between these environments\n * and uses the {@link environment.BrowserAdapter} by default.\n *\n * It has two methods: `get():Adapter` and `set(adapter: Adapter)`.\n *\n * Defaults to the {@link environment.BrowserAdapter}.\n * @example\n * import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';\n *\n * // WebWorkerAdapter is an implementation of the Adapter interface\n * DOMAdapter.set(WebWorkerAdapter);\n *\n * // use the adapter to create a canvas (in this case an OffscreenCanvas)\n * DOMAdapter.get().createCanvas(800, 600);\n * @memberof environment\n */\nexport const DOMAdapter = {\n /**\n * Returns the current adapter.\n * @returns {environment.Adapter} The current adapter.\n */\n get(): Adapter\n {\n return currentAdapter;\n },\n /**\n * Sets the current adapter.\n * @param adapter - The new adapter.\n */\n set(adapter: Adapter): void\n {\n currentAdapter = adapter;\n },\n};\n"],"names":["BrowserAdapter"],"mappings":";;;;;AAoDA,IAAI,cAA0B,GAAAA,6BAAA,CAAA;AAqBvB,MAAM,UAAa,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,GACA,GAAA;AACI,IAAO,OAAA,cAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OACJ,EAAA;AACI,IAAiB,cAAA,GAAA,OAAA,CAAA;AAAA,GACrB;AACJ;;;;"}

23
node_modules/pixi.js/lib/environment/adapter.mjs generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { BrowserAdapter } from '../environment-browser/BrowserAdapter.mjs';
"use strict";
let currentAdapter = BrowserAdapter;
const DOMAdapter = {
/**
* Returns the current adapter.
* @returns {environment.Adapter} The current adapter.
*/
get() {
return currentAdapter;
},
/**
* Sets the current adapter.
* @param adapter - The new adapter.
*/
set(adapter) {
currentAdapter = adapter;
}
};
export { DOMAdapter };
//# sourceMappingURL=adapter.mjs.map

1
node_modules/pixi.js/lib/environment/adapter.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"adapter.mjs","sources":["../../src/environment/adapter.ts"],"sourcesContent":["import { BrowserAdapter } from '../environment-browser/BrowserAdapter';\n\nimport type { ICanvas } from './canvas/ICanvas';\nimport type { ICanvasRenderingContext2D } from './canvas/ICanvasRenderingContext2D';\n\n/**\n * PixiJS supports multiple environments including browsers, Web Workers, and Node.js.\n * The environment is auto-detected by default using the {@link environment.autoDetectEnvironment} function.\n *\n * The {@link environment.Adapter} interface provides a way to abstract away the differences between\n * these environments. PixiJS uses the {@link environment.BrowserAdapter} by default.\n *\n * However you can manually set the environment using the {@link environment.DOMAdapter} singleton, for example to\n * use Pixi within a WebWorker.\n * ```js\n * import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';\n *\n * // WebWorkerAdapter is an implementation of the Adapter interface\n * DOMAdapter.set(WebWorkerAdapter);\n *\n * // use the adapter to create a canvas (in this case an OffscreenCanvas)\n * DOMAdapter.get().createCanvas(800, 600);\n * ```\n * @namespace environment\n */\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase.\n * Implementations of this interface can be used to make sure Pixi will work in any environment,\n * such as browser, Web Workers, and Node.js.\n * @memberof environment\n */\nexport interface Adapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => ICanvas;\n /** Returns a 2D rendering context. */\n getCanvasRenderingContext2D: () => { prototype: ICanvasRenderingContext2D; };\n /** Returns a WebGL rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string, gpu: GPU | null };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n /** Return the font face set if available */\n getFontFaceSet: () => FontFaceSet | null;\n /** Returns a Response object that has been fetched from the given URL. */\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n /** Returns Document object that has been parsed from the given XML string. */\n parseXML: (xml: string) => Document;\n}\n\nlet currentAdapter: Adapter = BrowserAdapter;\n\n/**\n * The DOMAdapter is a singleton that allows PixiJS to perform DOM operations, such as creating a canvas.\n * This allows PixiJS to be used in any environment, such as a web browser, Web Worker, or Node.js.\n * It uses the {@link environment.Adapter} interface to abstract away the differences between these environments\n * and uses the {@link environment.BrowserAdapter} by default.\n *\n * It has two methods: `get():Adapter` and `set(adapter: Adapter)`.\n *\n * Defaults to the {@link environment.BrowserAdapter}.\n * @example\n * import { DOMAdapter, WebWorkerAdapter } from 'pixi.js';\n *\n * // WebWorkerAdapter is an implementation of the Adapter interface\n * DOMAdapter.set(WebWorkerAdapter);\n *\n * // use the adapter to create a canvas (in this case an OffscreenCanvas)\n * DOMAdapter.get().createCanvas(800, 600);\n * @memberof environment\n */\nexport const DOMAdapter = {\n /**\n * Returns the current adapter.\n * @returns {environment.Adapter} The current adapter.\n */\n get(): Adapter\n {\n return currentAdapter;\n },\n /**\n * Sets the current adapter.\n * @param adapter - The new adapter.\n */\n set(adapter: Adapter): void\n {\n currentAdapter = adapter;\n },\n};\n"],"names":[],"mappings":";;;AAoDA,IAAI,cAA0B,GAAA,cAAA,CAAA;AAqBvB,MAAM,UAAa,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,GACA,GAAA;AACI,IAAO,OAAA,cAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,OACJ,EAAA;AACI,IAAiB,cAAA,GAAA,OAAA,CAAA;AAAA,GACrB;AACJ;;;;"}

View File

@@ -0,0 +1,10 @@
/**
* Automatically detects the environment and loads the appropriate extensions.
* @param skip - whether to skip loading the default extensions
*/
export declare function loadEnvironmentExtensions(skip: boolean): Promise<void>;
/**
* @param add - whether to add the default imports to the bundle
* @deprecated since 8.1.6. Use `loadEnvironmentExtensions` instead
*/
export declare function autoDetectEnvironment(add: boolean): Promise<void>;

View File

@@ -0,0 +1,25 @@
'use strict';
var Extensions = require('../extensions/Extensions.js');
"use strict";
const environments = [];
Extensions.extensions.handleByNamedList(Extensions.ExtensionType.Environment, environments);
async function loadEnvironmentExtensions(skip) {
if (skip)
return;
for (let i = 0; i < environments.length; i++) {
const env = environments[i];
if (env.value.test()) {
await env.value.load();
return;
}
}
}
async function autoDetectEnvironment(add) {
return loadEnvironmentExtensions(!add);
}
exports.autoDetectEnvironment = autoDetectEnvironment;
exports.loadEnvironmentExtensions = loadEnvironmentExtensions;
//# sourceMappingURL=autoDetectEnvironment.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"autoDetectEnvironment.js","sources":["../../src/environment/autoDetectEnvironment.ts"],"sourcesContent":["import { extensions, ExtensionType } from '../extensions/Extensions';\n\nconst environments: { name: string; value: { test: () => boolean; load: () => Promise<boolean> } }[] = [];\n\nextensions.handleByNamedList(ExtensionType.Environment, environments);\n\n/**\n * Automatically detects the environment and loads the appropriate extensions.\n * @param skip - whether to skip loading the default extensions\n */\nexport async function loadEnvironmentExtensions(skip: boolean): Promise<void>\n{\n if (skip) return;\n\n for (let i = 0; i < environments.length; i++)\n {\n const env = environments[i];\n\n if (env.value.test())\n {\n await env.value.load();\n\n return;\n }\n }\n}\n\n/**\n * @param add - whether to add the default imports to the bundle\n * @deprecated since 8.1.6. Use `loadEnvironmentExtensions` instead\n */\nexport async function autoDetectEnvironment(add: boolean): Promise<void>\n{\n return loadEnvironmentExtensions(!add);\n}\n"],"names":["extensions","ExtensionType"],"mappings":";;;;;AAEA,MAAM,eAAiG,EAAC,CAAA;AAExGA,qBAAW,CAAA,iBAAA,CAAkBC,wBAAc,CAAA,WAAA,EAAa,YAAY,CAAA,CAAA;AAMpE,eAAsB,0BAA0B,IAChD,EAAA;AACI,EAAI,IAAA,IAAA;AAAM,IAAA,OAAA;AAEV,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,YAAA,CAAa,QAAQ,CACzC,EAAA,EAAA;AACI,IAAM,MAAA,GAAA,GAAM,aAAa,CAAC,CAAA,CAAA;AAE1B,IAAI,IAAA,GAAA,CAAI,KAAM,CAAA,IAAA,EACd,EAAA;AACI,MAAM,MAAA,GAAA,CAAI,MAAM,IAAK,EAAA,CAAA;AAErB,MAAA,OAAA;AAAA,KACJ;AAAA,GACJ;AACJ,CAAA;AAMA,eAAsB,sBAAsB,GAC5C,EAAA;AACI,EAAO,OAAA,yBAAA,CAA0B,CAAC,GAAG,CAAA,CAAA;AACzC;;;;;"}

View File

@@ -0,0 +1,22 @@
import { extensions, ExtensionType } from '../extensions/Extensions.mjs';
"use strict";
const environments = [];
extensions.handleByNamedList(ExtensionType.Environment, environments);
async function loadEnvironmentExtensions(skip) {
if (skip)
return;
for (let i = 0; i < environments.length; i++) {
const env = environments[i];
if (env.value.test()) {
await env.value.load();
return;
}
}
}
async function autoDetectEnvironment(add) {
return loadEnvironmentExtensions(!add);
}
export { autoDetectEnvironment, loadEnvironmentExtensions };
//# sourceMappingURL=autoDetectEnvironment.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"autoDetectEnvironment.mjs","sources":["../../src/environment/autoDetectEnvironment.ts"],"sourcesContent":["import { extensions, ExtensionType } from '../extensions/Extensions';\n\nconst environments: { name: string; value: { test: () => boolean; load: () => Promise<boolean> } }[] = [];\n\nextensions.handleByNamedList(ExtensionType.Environment, environments);\n\n/**\n * Automatically detects the environment and loads the appropriate extensions.\n * @param skip - whether to skip loading the default extensions\n */\nexport async function loadEnvironmentExtensions(skip: boolean): Promise<void>\n{\n if (skip) return;\n\n for (let i = 0; i < environments.length; i++)\n {\n const env = environments[i];\n\n if (env.value.test())\n {\n await env.value.load();\n\n return;\n }\n }\n}\n\n/**\n * @param add - whether to add the default imports to the bundle\n * @deprecated since 8.1.6. Use `loadEnvironmentExtensions` instead\n */\nexport async function autoDetectEnvironment(add: boolean): Promise<void>\n{\n return loadEnvironmentExtensions(!add);\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,eAAiG,EAAC,CAAA;AAExG,UAAW,CAAA,iBAAA,CAAkB,aAAc,CAAA,WAAA,EAAa,YAAY,CAAA,CAAA;AAMpE,eAAsB,0BAA0B,IAChD,EAAA;AACI,EAAI,IAAA,IAAA;AAAM,IAAA,OAAA;AAEV,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,YAAA,CAAa,QAAQ,CACzC,EAAA,EAAA;AACI,IAAM,MAAA,GAAA,GAAM,aAAa,CAAC,CAAA,CAAA;AAE1B,IAAI,IAAA,GAAA,CAAI,KAAM,CAAA,IAAA,EACd,EAAA;AACI,MAAM,MAAA,GAAA,CAAI,MAAM,IAAK,EAAA,CAAA;AAErB,MAAA,OAAA;AAAA,KACJ;AAAA,GACJ;AACJ,CAAA;AAMA,eAAsB,sBAAsB,GAC5C,EAAA;AACI,EAAO,OAAA,yBAAA,CAA0B,CAAC,GAAG,CAAA,CAAA;AACzC;;;;"}

View File

@@ -0,0 +1,140 @@
/// <reference types="@webgpu/types" />
import type { ICanvasRenderingContext2D } from './ICanvasRenderingContext2D';
export type ContextIds = '2d' | 'bitmaprenderer' | 'webgl' | 'experimental-webgl' | 'webgl2' | 'experimental-webgl2' | 'webgpu';
export type PredefinedColorSpace = 'srgb' | 'display-p3';
export type RenderingContext = ICanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
export interface ICanvasRenderingContext2DSettings {
alpha?: boolean;
colorSpace?: PredefinedColorSpace;
desynchronized?: boolean;
willReadFrequently?: boolean;
}
export type ContextSettings = ICanvasRenderingContext2DSettings | ImageBitmapRenderingContextSettings | WebGLContextAttributes;
export interface ICanvasParentNode {
/** Adds a node to the end of the list of children of the parent node. */
appendChild(element: HTMLElement): void;
/** Removes a child node from the parent node. */
removeChild(element: HTMLElement): void;
removeChild(element: ICanvas): void;
}
export interface ICanvasStyle {
width?: string;
height?: string;
cursor?: string;
touchAction?: string;
msTouchAction?: string;
msContentZooming?: string;
}
export interface ICanvasRect {
x: number;
y: number;
width: number;
height: number;
}
export interface WebGLContextEventMap {
'webglcontextlost': WebGLContextEvent;
'webglcontextrestore': WebGLContextEvent;
}
/**
* Common interface for HTMLCanvasElement, OffscreenCanvas, and other custom canvas classes.
* @extends PixiMixins.ICanvas
* @extends Partial<EventTarget>
* @memberof environment
*/
export interface ICanvas extends PixiMixins.ICanvas, Partial<EventTarget> {
/** Width of the canvas. */
width: number;
/** Height of the canvas. */
height: number;
/**
* Get rendering context of the canvas.
* @param {ContextIds} contextId - The identifier of the type of context to create.
* @param {ContextSettings} options - The options for creating context.
* @returns {RenderingContext | null} The created context, or null if contextId is not supported.
*/
getContext(contextId: '2d', options?: ICanvasRenderingContext2DSettings): ICanvasRenderingContext2D | null;
getContext(contextId: 'bitmaprenderer', options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;
getContext(contextId: 'webgl' | 'experimental-webgl', options?: WebGLContextAttributes): WebGLRenderingContext | null;
getContext(contextId: 'webgl2' | 'experimental-webgl2', options?: WebGLContextAttributes): WebGL2RenderingContext | null;
getContext(contextId: 'webgpu'): GPUCanvasContext | null;
getContext(contextId: ContextIds, options?: ContextSettings): RenderingContext | null;
/**
* Get the content of the canvas as data URL.
* @param {string} [type] - A string indicating the image format. The default type is `image/png`;
* that type is also used if the given type isn't supported.
* @param {string} [quality] - A number between 0 and 1 indicating the image quality to be used when
* creating images using file formats that support lossy compression (such as `image/jpeg` or `image/webp`).
* A user agent will use its default quality value if this option is not specified, or if the number
* is outside the allowed range.
* @returns {string} A string containing the requested data URL.
*/
toDataURL?(type?: string, quality?: number): string;
/**
* Creates a Blob from the content of the canvas.
* @param {(blob: Blob | null) => void} callback - A callback function with the resulting `Blob` object
* as a single argument. `null` may be passed if the image cannot be created for any reason.
* @param {string} [type] - A string indicating the image format. The default type is `image/png`;
* that type is also used if the given type isn't supported.
* @param {string} [quality] - A number between 0 and 1 indicating the image quality to be used when
* creating images using file formats that support lossy compression (such as `image/jpeg` or `image/webp`).
* A user agent will use its default quality value if this option is not specified, or if the number
* is outside the allowed range.
* @returns {void}
*/
toBlob?(callback: (blob: Blob | null) => void, type?: string, quality?: number): void;
/**
* Get the content of the canvas as Blob.
* @param {object} [options] - The options for creating Blob.
* @param {string} [options.type] - A string indicating the image format. The default type is `image/png`;
* that type is also used if the given type isn't supported.
* @param {string} [options.quality] - A number between 0 and 1 indicating the image quality to be used when
* creating images using file formats that support lossy compression (such as `image/jpeg` or `image/webp`).
* A user agent will use its default quality value if this option is not specified, or if the number
* is outside the allowed range.
* @returns {Promise<Blob>} A `Promise` returning a Blob object representing the image contained in the canvas.
*/
convertToBlob?(options?: {
type?: string;
quality?: number;
}): Promise<Blob>;
/**
* Adds the listener for the specified event.
* @method
* @param {string} type - The type of event to listen for.
* @param {EventListenerOrEventListenerObject} listener - The callback to invoke when the event is fired.
* @param {boolean | AddEventListenerOptions} options - The options for adding event listener.
* @returns {void}
*/
addEventListener?: {
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
<K extends keyof WebGLContextEventMap>(type: K, listener: (this: ICanvas, ev: WebGLContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
};
/**
* Removes the listener for the specified event.
* @method
* @param {string} type - The type of event to listen for.
* @param {EventListenerOrEventListenerObject} listener - The callback to invoke when the event is fired.
* @param {boolean | EventListenerOptions} options - The options for removing event listener.
* @returns {void}
*/
removeEventListener?: {
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
<K extends keyof WebGLContextEventMap>(type: K, listener: (this: ICanvas, ev: WebGLContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
};
/**
* Dispatches a event.
* @param {Event} event - The Event object to dispatch. Its Event.target property will be set to the current EventTarget.
* @returns {boolean} Returns false if event is cancelable, and at least one of the event handlers which received event
* called Event.preventDefault(). Otherwise true.
*/
dispatchEvent(event: Event): boolean;
/** Parent node of the canvas. */
readonly parentNode?: ICanvasParentNode | null;
/** Style of the canvas. */
readonly style?: ICanvasStyle;
/**
* Get the position and the size of the canvas.
* @returns The smallest rectangle which contains the entire canvas.
*/
getBoundingClientRect?(): ICanvasRect;
}

View File

@@ -0,0 +1,4 @@
'use strict';
"use strict";
//# sourceMappingURL=ICanvas.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvas.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=ICanvas.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvas.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,17 @@
import type { ICanvas } from './ICanvas';
/**
* Common interface for CanvasRenderingContext2D, OffscreenCanvasRenderingContext2D, and other custom canvas 2D context.
* @memberof environment
*/
export interface ICanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, Omit<CanvasTextDrawingStyles, 'letterSpacing'>, CanvasPath {
/** creates a pattern using the specified image and repetition. */
createPattern(image: CanvasImageSource | ICanvas, repetition: string | null): CanvasPattern | null;
/** provides different ways to draw an image onto the canvas */
drawImage(image: CanvasImageSource | ICanvas, dx: number, dy: number): void;
drawImage(image: CanvasImageSource | ICanvas, dx: number, dy: number, dw: number, dh: number): void;
drawImage(image: CanvasImageSource | ICanvas, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
/** sets the horizontal spacing behavior between text characters. */
letterSpacing?: string;
/** sets the horizontal spacing behavior between text characters. */
textLetterSpacing?: string;
}

View File

@@ -0,0 +1,4 @@
'use strict';
"use strict";
//# sourceMappingURL=ICanvasRenderingContext2D.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvasRenderingContext2D.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=ICanvasRenderingContext2D.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ICanvasRenderingContext2D.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

4
node_modules/pixi.js/lib/environment/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export * from './adapter';
export * from './autoDetectEnvironment';
export * from './canvas/ICanvas';
export * from './canvas/ICanvasRenderingContext2D';

13
node_modules/pixi.js/lib/environment/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
var adapter = require('./adapter.js');
var autoDetectEnvironment = require('./autoDetectEnvironment.js');
require('./canvas/ICanvas.js');
require('./canvas/ICanvasRenderingContext2D.js');
"use strict";
exports.DOMAdapter = adapter.DOMAdapter;
exports.autoDetectEnvironment = autoDetectEnvironment.autoDetectEnvironment;
exports.loadEnvironmentExtensions = autoDetectEnvironment.loadEnvironmentExtensions;
//# sourceMappingURL=index.js.map

1
node_modules/pixi.js/lib/environment/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}

7
node_modules/pixi.js/lib/environment/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export { DOMAdapter } from './adapter.mjs';
export { autoDetectEnvironment, loadEnvironmentExtensions } from './autoDetectEnvironment.mjs';
import './canvas/ICanvas.mjs';
import './canvas/ICanvasRenderingContext2D.mjs';
"use strict";
//# sourceMappingURL=index.mjs.map

1
node_modules/pixi.js/lib/environment/index.mjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}