Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/assets

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/assets - npm Package Compare versions

Comparing version 7.2.0-beta to 7.2.0-beta.2

global.d.ts

22

lib/Assets.d.ts

@@ -6,2 +6,3 @@ import { Cache } from './cache/Cache';

import type { LoadAsset } from './loader';
import type { LoadTextureConfig } from './loader/parsers';
import type { ResolveAsset, ResolverBundle, ResolverManifest } from './resolver';

@@ -11,2 +12,9 @@ import type { BundleIdentifierOptions } from './resolver/Resolver';

/**
* Extensible preferences that can be used, for instance, when configuring loaders.
* @since 7.2.0
* @memberof PIXI
*/
export interface AssetsPreferences extends LoadTextureConfig, GlobalMixins.AssetsPreferences {
}
/**
* Initialization options object for Asset Class.

@@ -38,2 +46,4 @@ * @memberof PIXI

bundleIdentifier?: BundleIdentifierOptions;
/** Optional loader preferences */
preferences?: Partial<AssetsPreferences>;
}

@@ -477,11 +487,13 @@ /**

/**
* When set to `true`, loading and decoding images will happen with Worker thread,
* if available on the browser. This is much more performant as network requests
* and decoding can be expensive on the CPU. However, not all environments support
* Workers, in some cases it can be helpful to disable by setting to `false`.
* @default true
* @deprecated since 7.2.0
* @see {@link Assets.setPreferences}
*/
get preferWorkers(): boolean;
set preferWorkers(value: boolean);
/**
* General setter for preferences. This is a helper function to set preferences on all parsers.
* @param preferences - the preferences to set
*/
setPreferences(preferences: Partial<AssetsPreferences>): void;
}
export declare const Assets: AssetsClass;

@@ -6,2 +6,3 @@ 'use strict';

var core = require('@pixi/core');
var utils = require('@pixi/utils');
var BackgroundLoader = require('./BackgroundLoader.js');

@@ -73,2 +74,5 @@ var Cache = require('./cache/Cache.js');

});
if (options.preferences) {
this.setPreferences(options.preferences);
}
}

@@ -214,4 +218,14 @@ add(keysIn, assetsIn, data) {

set preferWorkers(value) {
loadTextures.loadTextures.config.preferWorkers = value;
utils.deprecation("7.2.0", "Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead.");
this.setPreferences({ preferWorkers: value });
}
setPreferences(preferences) {
this.loader.parsers.forEach((parser) => {
if (!parser.config)
return;
Object.keys(parser.config).filter((key) => key in preferences).forEach((key) => {
parser.config[key] = preferences[key];
});
});
}
}

@@ -218,0 +232,0 @@ const Assets = new AssetsClass();

@@ -0,1 +1,2 @@

/// <reference path="../global.d.ts" />
export * from './AssetExtension';

@@ -2,0 +3,0 @@ export * from './Assets';

@@ -34,6 +34,6 @@ import type { ExtensionMetadata } from '@pixi/core';

*/
export interface LoaderParser<ASSET = any, META_DATA = any> {
export interface LoaderParser<ASSET = any, META_DATA = any, CONFIG = Record<string, any>> {
extension?: ExtensionMetadata;
/** A config to adjust the parser */
config?: Record<string, any>;
config?: CONFIG;
/**

@@ -40,0 +40,0 @@ * each URL to load will be tested here,

import type { LoaderParser } from './LoaderParser';
/** simple loader plugin for loading json data */
export declare const loadJson: LoaderParser<any, any>;
export declare const loadJson: LoaderParser<any, any, Record<string, any>>;
import type { LoaderParser } from './LoaderParser';
/** Simple loader plugin for loading text data */
export declare const loadTxt: LoaderParser<any, any>;
export declare const loadTxt: LoaderParser<any, any, Record<string, any>>;

@@ -24,2 +24,2 @@ /// <reference types="css-font-loading-module" />

/** Web font loader plugin */
export declare const loadWebFont: LoaderParser<FontFace | FontFace[], any>;
export declare const loadWebFont: LoaderParser<FontFace | FontFace[], any, Record<string, any>>;
import type { IBaseTextureOptions, Texture } from '@pixi/core';
import type { LoaderParser } from '../LoaderParser';
/** Loads SVG's into Textures */
export declare const loadSVG: LoaderParser<string | Texture<import("@pixi/core").Resource>, IBaseTextureOptions<any>>;
export declare const loadSVG: LoaderParser<string | Texture<import("@pixi/core").Resource>, IBaseTextureOptions<any>, Record<string, any>>;
import type { IBaseTextureOptions, Texture } from '@pixi/core';
import type { LoaderParser } from '../LoaderParser';
/**
* Configuration for the `loadTextures` loader plugin.
* @memberof PIXI
* @see PIXI.loadTextures
*/
export interface LoadTextureConfig {
/**
* When set to `true`, loading and decoding images will happen with Worker thread,
* if available on the browser. This is much more performant as network requests
* and decoding can be expensive on the CPU. However, not all environments support
* Workers, in some cases it can be helpful to disable by setting to `false`.
* @default true
*/
preferWorkers: boolean;
/**
* When set to `true`, loading and decoding images will happen with `createImageBitmap`,
* otherwise it will use `new Image()`.
* @default true
*/
preferCreateImageBitmap: boolean;
/**
* The crossOrigin value to use for images when `preferCreateImageBitmap` is `false`.
* @default 'anonymous'
*/
crossOrigin: HTMLImageElement['crossOrigin'];
}
/**
* Returns a promise that resolves an ImageBitmaps.

@@ -29,3 +55,4 @@ * This function is designed to be used by a worker.

* ```
* @memberof PIXI
*/
export declare const loadTextures: LoaderParser<Texture<import("@pixi/core").Resource>, IBaseTextureOptions<any>>;
export declare const loadTextures: LoaderParser<Texture<import("@pixi/core").Resource>, IBaseTextureOptions<any>, LoadTextureConfig>;
{
"name": "@pixi/assets",
"version": "7.2.0-beta",
"version": "7.2.0-beta.2",
"description": "Asset manager for PixiJS, loading resolving and Cacheing",

@@ -50,4 +50,5 @@ "keywords": [

"pixiRequirements": [
"@pixi/core"
"@pixi/core",
"@pixi/utils"
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc