modern-canvas 0.13.1 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Engine.d.ts CHANGED
@@ -8,7 +8,6 @@ export interface EngineProperties extends WebGLContextAttributes, SceneTreePrope
8
8
  pixelRatio?: number;
9
9
  autoResize: boolean;
10
10
  autoStart: boolean;
11
- msaa: boolean;
12
11
  }
13
12
  interface EngineEvents extends SceneTreeEvents {
14
13
  }
@@ -27,7 +26,6 @@ export declare const defaultOptions: {
27
26
  readonly powerPreference: "default";
28
27
  };
29
28
  export declare class Engine extends SceneTree {
30
- msaa: boolean;
31
29
  autoResize: boolean;
32
30
  autoStart: boolean;
33
31
  readonly renderer: WebGLRenderer;
@@ -2,7 +2,7 @@ import type { ObservableEvents } from 'modern-idoc';
2
2
  import type { Loader } from './loaders';
3
3
  import { Observable } from 'modern-idoc';
4
4
  import { FontLoader, GifLoader, JsonLoader, LottieLoader, TextLoader, TextureLoader, VideoLoader } from './loaders';
5
- export type AssetHandler = (url: string, options?: any) => any | Promise<any>;
5
+ export type AssetHandler = (blob: Blob, options?: any) => any | Promise<any>;
6
6
  export interface Assets {
7
7
  font: FontLoader;
8
8
  gif: GifLoader;
@@ -27,10 +27,10 @@ export declare class Assets extends Observable<AssetsEvents> {
27
27
  register(mimeType: string, handler: AssetHandler): this;
28
28
  fetch(url: string): Promise<Response>;
29
29
  protected _fixSVG(dataURI: string): string;
30
- fetchImageBitmap(url: string, options?: ImageBitmapOptions): Promise<ImageBitmap>;
30
+ fetchImageBitmap(url: string | Blob, options?: ImageBitmapOptions): Promise<ImageBitmap>;
31
31
  get<T>(id: string): T | undefined;
32
32
  set(id: string, value: any): void;
33
- loadBy<T>(id: string, handler: () => Promise<T>): Promise<T>;
33
+ loadBy<T = Blob>(id: string, handler?: () => Promise<T>): Promise<T>;
34
34
  load<T>(url: string, options?: any): Promise<T>;
35
35
  waitUntilLoad(): Promise<void>;
36
36
  gc(): void;
@@ -2,6 +2,6 @@ import type { Font } from 'modern-font';
2
2
  import type { Assets } from '../Assets';
3
3
  import { Loader } from './Loader';
4
4
  export declare class FontLoader extends Loader {
5
- load: (url: string) => Promise<Font>;
5
+ load: (url: string | Blob) => Promise<Font>;
6
6
  install(assets: Assets): this;
7
7
  }
@@ -2,6 +2,6 @@ import type { Assets } from '../Assets';
2
2
  import { AnimatedTexture } from '../../scene';
3
3
  import { Loader } from './Loader';
4
4
  export declare class GifLoader extends Loader {
5
- load: (url: string) => Promise<AnimatedTexture>;
5
+ load: (url: string | Blob) => Promise<AnimatedTexture>;
6
6
  install(assets: Assets): this;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { Assets } from '../Assets';
2
2
  import { Loader } from './Loader';
3
3
  export declare class JsonLoader extends Loader {
4
- load: (url: string) => Promise<Record<string, any>>;
4
+ load: (url: string | Blob) => Promise<Record<string, any>>;
5
5
  install(assets: Assets): this;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import type { Assets } from '../Assets';
2
2
  import { Loader } from './Loader';
3
3
  export declare class TextLoader extends Loader {
4
- load: (url: string) => Promise<string>;
4
+ load: (url: string | Blob) => Promise<string>;
5
5
  install(assets: Assets): this;
6
6
  }
@@ -2,6 +2,6 @@ import type { Assets } from '../Assets';
2
2
  import { Texture2D } from '../../scene';
3
3
  import { Loader } from './Loader';
4
4
  export declare class TextureLoader extends Loader {
5
- load: (url: string) => Promise<Texture2D<ImageBitmap>>;
5
+ load: (url: string | Blob) => Promise<Texture2D<ImageBitmap>>;
6
6
  install(assets: Assets): this;
7
7
  }
@@ -1 +1 @@
1
- export declare function parseMimeType(url: string): Promise<string>;
1
+ export declare function parseMimeType(url: string): string | undefined;