@hi-ashleyj/llama 0.13.1 → 0.14.0

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.
Files changed (77) hide show
  1. package/dist/Game.svelte +154 -129
  2. package/dist/Game.svelte.d.ts +10 -21
  3. package/dist/Layer.svelte +61 -46
  4. package/dist/Layer.svelte.d.ts +9 -20
  5. package/dist/audio/AudioCompressor.svelte +70 -44
  6. package/dist/audio/AudioCompressor.svelte.d.ts +14 -23
  7. package/dist/audio/AudioGain.svelte +33 -20
  8. package/dist/audio/AudioGain.svelte.d.ts +6 -17
  9. package/dist/audio/AudioListenerPosition.svelte +79 -93
  10. package/dist/audio/AudioListenerPosition.svelte.d.ts +6 -16
  11. package/dist/audio/AudioPanner.svelte +33 -20
  12. package/dist/audio/AudioPanner.svelte.d.ts +6 -17
  13. package/dist/audio/BufferedAudioSource.svelte +59 -44
  14. package/dist/audio/BufferedAudioSource.svelte.d.ts +8 -18
  15. package/dist/audio/MediaAudioSource.svelte +56 -35
  16. package/dist/audio/MediaAudioSource.svelte.d.ts +13 -25
  17. package/dist/audio/context.d.ts +1 -1
  18. package/dist/controllers/MouseClickable.svelte +61 -49
  19. package/dist/controllers/MouseClickable.svelte.d.ts +11 -20
  20. package/dist/controllers/MouseEventArea.svelte +71 -55
  21. package/dist/controllers/MouseEventArea.svelte.d.ts +13 -26
  22. package/dist/controllers/motions.d.ts +4 -5
  23. package/dist/drawables/Arc.svelte +48 -30
  24. package/dist/drawables/Arc.svelte.d.ts +9 -19
  25. package/dist/drawables/Circle.svelte +38 -24
  26. package/dist/drawables/Circle.svelte.d.ts +7 -17
  27. package/dist/drawables/DisplayImage.svelte +26 -16
  28. package/dist/drawables/DisplayImage.svelte.d.ts +11 -21
  29. package/dist/drawables/MultiLineText.svelte +75 -45
  30. package/dist/drawables/MultiLineText.svelte.d.ts +14 -24
  31. package/dist/drawables/Rectangle.svelte +35 -22
  32. package/dist/drawables/Rectangle.svelte.d.ts +7 -17
  33. package/dist/drawables/RoundedRectangle.svelte +41 -23
  34. package/dist/drawables/RoundedRectangle.svelte.d.ts +8 -18
  35. package/dist/drawables/Text.svelte +63 -40
  36. package/dist/drawables/Text.svelte.d.ts +13 -23
  37. package/dist/drawables/Tiled.svelte +79 -61
  38. package/dist/drawables/Tiled.svelte.d.ts +10 -20
  39. package/dist/extras/DefaultFontFace.svelte +35 -17
  40. package/dist/extras/DefaultFontFace.svelte.d.ts +15 -24
  41. package/dist/extras/FullScreenEventHandler.svelte +37 -23
  42. package/dist/extras/FullScreenEventHandler.svelte.d.ts +9 -19
  43. package/dist/extras/LayerPortal.svelte +36 -22
  44. package/dist/extras/LayerPortal.svelte.d.ts +6 -17
  45. package/dist/extras/SensibleDefaultStyles.svelte +8 -2
  46. package/dist/extras/SensibleDefaultStyles.svelte.d.ts +5 -17
  47. package/dist/extras/Tweened.svelte +28 -9
  48. package/dist/extras/Tweened.svelte.d.ts +12 -22
  49. package/dist/primitives/Area.svelte +46 -22
  50. package/dist/primitives/Area.svelte.d.ts +14 -24
  51. package/dist/primitives/Empty.svelte +7 -2
  52. package/dist/primitives/Empty.svelte.d.ts +5 -15
  53. package/dist/primitives/Inset.svelte +45 -26
  54. package/dist/primitives/Inset.svelte.d.ts +9 -20
  55. package/dist/primitives/Node.svelte +32 -19
  56. package/dist/primitives/Node.svelte.d.ts +7 -18
  57. package/dist/primitives/Opacity.svelte +34 -22
  58. package/dist/primitives/Opacity.svelte.d.ts +6 -17
  59. package/dist/primitives/Rotate.svelte +33 -22
  60. package/dist/primitives/Rotate.svelte.d.ts +11 -21
  61. package/dist/primitives/Translate.svelte +32 -19
  62. package/dist/primitives/Translate.svelte.d.ts +7 -18
  63. package/dist/resources/AssetPool.svelte +7 -2
  64. package/dist/resources/AssetPool.svelte.d.ts +5 -15
  65. package/dist/resources/AudioBufferedAsset.svelte +14 -6
  66. package/dist/resources/AudioBufferedAsset.svelte.d.ts +5 -15
  67. package/dist/resources/AudioMediaAsset.svelte +10 -2
  68. package/dist/resources/AudioMediaAsset.svelte.d.ts +5 -15
  69. package/dist/resources/ImageAsset.svelte +16 -9
  70. package/dist/resources/ImageAsset.svelte.d.ts +5 -15
  71. package/dist/resources/audio.d.ts +1 -1
  72. package/dist/resources/images.d.ts +1 -1
  73. package/dist/scenes/SceneSwitcher.svelte +27 -16
  74. package/dist/scenes/SceneSwitcher.svelte.d.ts +5 -16
  75. package/dist/scenes/SceneTransition.svelte +47 -36
  76. package/dist/scenes/SceneTransition.svelte.d.ts +6 -20
  77. package/package.json +10 -9
@@ -1,21 +1,10 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- left?: number | undefined;
5
- right?: number | undefined;
6
- top?: number | undefined;
7
- bottom?: number | undefined;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {
13
- default: {};
14
- };
15
- };
16
- export type InsetProps = typeof __propDef.props;
17
- export type InsetEvents = typeof __propDef.events;
18
- export type InsetSlots = typeof __propDef.slots;
19
- export default class Inset extends SvelteComponent<InsetProps, InsetEvents, InsetSlots> {
1
+ interface Props {
2
+ left?: number;
3
+ right?: number;
4
+ top?: number;
5
+ bottom?: number;
6
+ children?: import('svelte').Snippet;
20
7
  }
21
- export {};
8
+ declare const Inset: import("svelte").Component<Props, {}, "">;
9
+ type Inset = ReturnType<typeof Inset>;
10
+ export default Inset;
@@ -1,22 +1,35 @@
1
- <script>import { setupDrawable } from "../drawable.js";
2
- import { onMount } from "svelte";
3
- export let x;
4
- export let y;
5
- const targets = /* @__PURE__ */ new Set();
6
- const draw = function({ width, height, ctx }) {
7
- targets.forEach((f) => f.draw({ width, height, ctx }, { x, y }));
8
- };
9
- let register = setupDrawable({
10
- assign: (ctx) => {
11
- targets.add(ctx);
12
- return () => {
13
- targets.delete(ctx);
1
+ <script lang="ts">
2
+
3
+ import { setupDrawable, type DrawFunction } from "../drawable.js";
4
+ import { onMount } from "svelte";
5
+
6
+ interface Props {
7
+ x: number;
8
+ y: number;
9
+ children?: import('svelte').Snippet;
10
+ }
11
+
12
+ let { x, y, children }: Props = $props();
13
+
14
+ const targets = new Set<{ draw: DrawFunction<{x: number, y: number}> }>();
15
+
16
+ const draw: DrawFunction<null> = function ( { width, height, ctx } ) {
17
+ targets.forEach(f => f.draw({ width, height, ctx }, { x, y }));
14
18
  };
15
- }
16
- });
17
- onMount(() => {
18
- return register({ draw });
19
- });
19
+
20
+ let register = setupDrawable<null, {x: number, y: number}>({
21
+ assign: (ctx) => {
22
+ targets.add(ctx);
23
+ return () => {
24
+ targets.delete(ctx);
25
+ };
26
+ },
27
+ });
28
+
29
+ onMount(() => {
30
+ return register({ draw });
31
+ });
32
+
20
33
  </script>
21
34
 
22
- <slot/>
35
+ {@render children?.()}
@@ -1,19 +1,8 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- x: number;
5
- y: number;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {
11
- default: {};
12
- };
13
- };
14
- export type NodeProps = typeof __propDef.props;
15
- export type NodeEvents = typeof __propDef.events;
16
- export type NodeSlots = typeof __propDef.slots;
17
- export default class Node extends SvelteComponent<NodeProps, NodeEvents, NodeSlots> {
1
+ interface Props {
2
+ x: number;
3
+ y: number;
4
+ children?: import('svelte').Snippet;
18
5
  }
19
- export {};
6
+ declare const Node: import("svelte").Component<Props, {}, "">;
7
+ type Node = ReturnType<typeof Node>;
8
+ export default Node;
@@ -1,25 +1,37 @@
1
- <script>import { setupDrawable } from "../drawable.js";
2
- import { onMount } from "svelte";
3
- export let opacity;
4
- const targets = /* @__PURE__ */ new Set();
5
- const draw = function({ width, height, ctx }, offset) {
6
- if (opacity <= 0)
7
- return;
8
- ctx.globalAlpha = Math.min(opacity, 1);
9
- targets.forEach((f) => f.draw({ width, height, ctx }, offset));
10
- ctx.globalAlpha = 1;
11
- };
12
- let register = setupDrawable({
13
- assign: (ctx) => {
14
- targets.add(ctx);
15
- return () => {
16
- targets.delete(ctx);
1
+ <script lang="ts">
2
+
3
+ import { setupDrawable, type DrawFunction } from "../drawable.js";
4
+ import { onMount } from "svelte";
5
+
6
+ interface Props {
7
+ opacity: number;
8
+ children?: import('svelte').Snippet;
9
+ }
10
+
11
+ let { opacity, children }: Props = $props();
12
+
13
+ const targets = new Set<{ draw: DrawFunction<unknown> }>();
14
+
15
+ const draw: DrawFunction<unknown> = function ( { width, height, ctx }, offset ) {
16
+ if (opacity <= 0) return;
17
+ ctx.globalAlpha = Math.min(opacity, 1);
18
+ targets.forEach(f => f.draw({ width, height, ctx }, offset));
19
+ ctx.globalAlpha = 1;
17
20
  };
18
- }
19
- });
20
- onMount(() => {
21
- return register({ draw });
22
- });
21
+
22
+ let register = setupDrawable<unknown, unknown>({
23
+ assign: (ctx) => {
24
+ targets.add(ctx);
25
+ return () => {
26
+ targets.delete(ctx);
27
+ };
28
+ },
29
+ });
30
+
31
+ onMount(() => {
32
+ return register({ draw });
33
+ });
34
+
23
35
  </script>
24
36
 
25
- <slot/>
37
+ {@render children?.()}
@@ -1,18 +1,7 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- opacity: number;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {
10
- default: {};
11
- };
12
- };
13
- export type OpacityProps = typeof __propDef.props;
14
- export type OpacityEvents = typeof __propDef.events;
15
- export type OpacitySlots = typeof __propDef.slots;
16
- export default class Opacity extends SvelteComponent<OpacityProps, OpacityEvents, OpacitySlots> {
1
+ interface Props {
2
+ opacity: number;
3
+ children?: import('svelte').Snippet;
17
4
  }
18
- export {};
5
+ declare const Opacity: import("svelte").Component<Props, {}, "">;
6
+ type Opacity = ReturnType<typeof Opacity>;
7
+ export default Opacity;
@@ -1,25 +1,36 @@
1
- <script>import { setupDrawable } from "../drawable.js";
2
- import { onMount } from "svelte";
3
- export let centered = false;
4
- export let degrees;
5
- const targets = /* @__PURE__ */ new Set();
6
- const draw = function({ width, height, ctx }, { x, y, w, h }) {
7
- ctx.translate(x, y);
8
- ctx.rotate(degrees * Math.PI / 180);
9
- targets.forEach((f) => f.draw({ width, height, ctx }, { x: centered ? w * -0.5 : 0, y: centered ? h * -0.5 : 0, w, h }));
10
- ctx.resetTransform();
11
- };
12
- let register = setupDrawable({
13
- assign: (ctx) => {
14
- targets.add(ctx);
15
- return () => {
16
- targets.delete(ctx);
1
+ <script lang="ts">
2
+ import { setupDrawable, type DrawFunction } from "../drawable.js";
3
+ import { onMount } from "svelte";
4
+
5
+ interface Props {
6
+ /**
7
+ * FALSE = ANCHOR TOP LEFT
8
+ * TRUE = ANCHOR CENTER
9
+ */
10
+ centered?: boolean;
11
+ degrees: number;
12
+ children?: import('svelte').Snippet;
13
+ }
14
+
15
+ let { centered = false, degrees, children }: Props = $props();
16
+ const targets = new Set<{ draw: DrawFunction<{ x: number, y: number, w: number, h: number }> }>();
17
+ const draw: DrawFunction<{ x: number, y: number, w: number, h: number }> = function ( { width, height, ctx }, { x, y, w, h} ) {
18
+ ctx.translate(x, y);
19
+ ctx.rotate(degrees * Math.PI / 180 )
20
+ targets.forEach(f => f.draw({ width, height, ctx }, { x: (centered) ? w * -0.5 : 0, y: (centered) ? h * -0.5 : 0, w, h }));
21
+ ctx.resetTransform();
17
22
  };
18
- }
19
- });
20
- onMount(() => {
21
- return register({ draw });
22
- });
23
+ let register = setupDrawable<{ x: number, y: number, w: number, h: number }, { x: number, y: number, w: number, h: number }>({
24
+ assign: (ctx) => {
25
+ targets.add(ctx);
26
+ return () => {
27
+ targets.delete(ctx);
28
+ };
29
+ },
30
+ });
31
+ onMount(() => {
32
+ return register({ draw });
33
+ });
23
34
  </script>
24
35
 
25
- <slot/>
36
+ {@render children?.()}
@@ -1,22 +1,12 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- /**
5
- * FALSE = ANCHOR TOP LEFT
6
- * TRUE = ANCHOR CENTER
7
- */ centered?: boolean | undefined;
8
- degrees: number;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {
14
- default: {};
15
- };
16
- };
17
- export type RotateProps = typeof __propDef.props;
18
- export type RotateEvents = typeof __propDef.events;
19
- export type RotateSlots = typeof __propDef.slots;
20
- export default class Rotate extends SvelteComponent<RotateProps, RotateEvents, RotateSlots> {
1
+ interface Props {
2
+ /**
3
+ * FALSE = ANCHOR TOP LEFT
4
+ * TRUE = ANCHOR CENTER
5
+ */
6
+ centered?: boolean;
7
+ degrees: number;
8
+ children?: import('svelte').Snippet;
21
9
  }
22
- export {};
10
+ declare const Rotate: import("svelte").Component<Props, {}, "">;
11
+ type Rotate = ReturnType<typeof Rotate>;
12
+ export default Rotate;
@@ -1,22 +1,35 @@
1
- <script>import { setupDrawable } from "../drawable.js";
2
- import { onMount } from "svelte";
3
- export let x;
4
- export let y;
5
- const targets = /* @__PURE__ */ new Set();
6
- const draw = function({ width, height, ctx }, offset) {
7
- targets.forEach((f) => f.draw({ width, height, ctx }, { x: offset.x + x, y: offset.y + y }));
8
- };
9
- let register = setupDrawable({
10
- assign: (ctx) => {
11
- targets.add(ctx);
12
- return () => {
13
- targets.delete(ctx);
1
+ <script lang="ts">
2
+
3
+ import { setupDrawable, type DrawFunction } from "../drawable.js";
4
+ import { onMount } from "svelte";
5
+
6
+ interface Props {
7
+ x: number;
8
+ y: number;
9
+ children?: import('svelte').Snippet;
10
+ }
11
+
12
+ let { x, y, children }: Props = $props();
13
+
14
+ const targets = new Set<{ draw: DrawFunction<{x: number, y: number}> }>();
15
+
16
+ const draw: DrawFunction<{x: number, y: number}> = function ( { width, height, ctx }, offset ) {
17
+ targets.forEach(f => f.draw({ width, height, ctx }, { x: offset.x + x, y: offset.y + y }));
14
18
  };
15
- }
16
- });
17
- onMount(() => {
18
- return register({ draw });
19
- });
19
+
20
+ let register = setupDrawable<{x: number, y: number}, {x: number, y: number}>({
21
+ assign: (ctx) => {
22
+ targets.add(ctx);
23
+ return () => {
24
+ targets.delete(ctx);
25
+ };
26
+ },
27
+ });
28
+
29
+ onMount(() => {
30
+ return register({ draw });
31
+ });
32
+
20
33
  </script>
21
34
 
22
- <slot/>
35
+ {@render children?.()}
@@ -1,19 +1,8 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- x: number;
5
- y: number;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {
11
- default: {};
12
- };
13
- };
14
- export type TranslateProps = typeof __propDef.props;
15
- export type TranslateEvents = typeof __propDef.events;
16
- export type TranslateSlots = typeof __propDef.slots;
17
- export default class Translate extends SvelteComponent<TranslateProps, TranslateEvents, TranslateSlots> {
1
+ interface Props {
2
+ x: number;
3
+ y: number;
4
+ children?: import('svelte').Snippet;
18
5
  }
19
- export {};
6
+ declare const Translate: import("svelte").Component<Props, {}, "">;
7
+ type Translate = ReturnType<typeof Translate>;
8
+ export default Translate;
@@ -1,7 +1,12 @@
1
- <script></script>
1
+ <script lang="ts">
2
+ interface Props {
3
+ children?: import('svelte').Snippet;
4
+ }
5
+
6
+ let { children }: Props = $props();</script>
2
7
 
3
8
  <div class="-llama-asset-pool--">
4
- <slot />
9
+ {@render children?.()}
5
10
  </div>
6
11
 
7
12
  <style>
@@ -1,16 +1,6 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {
8
- default: {};
9
- };
10
- };
11
- export type AssetPoolProps = typeof __propDef.props;
12
- export type AssetPoolEvents = typeof __propDef.events;
13
- export type AssetPoolSlots = typeof __propDef.slots;
14
- export default class AssetPool extends SvelteComponent<AssetPoolProps, AssetPoolEvents, AssetPoolSlots> {
1
+ interface Props {
2
+ children?: import('svelte').Snippet;
15
3
  }
16
- export {};
4
+ declare const AssetPool: import("svelte").Component<Props, {}, "">;
5
+ type AssetPool = ReturnType<typeof AssetPool>;
6
+ export default AssetPool;
@@ -1,7 +1,15 @@
1
- <script>import { onMount } from "svelte";
2
- import { pushBufferAsset } from "./audio.js";
3
- export let url;
4
- onMount(() => {
5
- pushBufferAsset(url);
6
- });
1
+ <script lang="ts">
2
+ import { onMount } from "svelte";
3
+ import { pushBufferAsset } from "./audio.js";
4
+
5
+ interface Props {
6
+ url: any;
7
+ }
8
+
9
+ let { url }: Props = $props();
10
+
11
+ onMount(() => {
12
+ pushBufferAsset(url);
13
+ })
14
+
7
15
  </script>
@@ -1,16 +1,6 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- url: any;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- };
11
- export type AudioBufferedAssetProps = typeof __propDef.props;
12
- export type AudioBufferedAssetEvents = typeof __propDef.events;
13
- export type AudioBufferedAssetSlots = typeof __propDef.slots;
14
- export default class AudioBufferedAsset extends SvelteComponent<AudioBufferedAssetProps, AudioBufferedAssetEvents, AudioBufferedAssetSlots> {
1
+ interface Props {
2
+ url: any;
15
3
  }
16
- export {};
4
+ declare const AudioBufferedAsset: import("svelte").Component<Props, {}, "">;
5
+ type AudioBufferedAsset = ReturnType<typeof AudioBufferedAsset>;
6
+ export default AudioBufferedAsset;
@@ -1,4 +1,12 @@
1
- <script>export let url;
1
+ <script lang="ts">
2
+
3
+ // this component is stupid as audio media sources don't re-use the asset - this only preloads the asset.0
4
+ interface Props {
5
+ url: any;
6
+ }
7
+
8
+ let { url }: Props = $props();
9
+
2
10
  </script>
3
11
 
4
- <audio src={url} muted preload="auto" />
12
+ <audio src={url} muted preload="auto"></audio>
@@ -1,16 +1,6 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- url: any;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- };
11
- export type AudioMediaAssetProps = typeof __propDef.props;
12
- export type AudioMediaAssetEvents = typeof __propDef.events;
13
- export type AudioMediaAssetSlots = typeof __propDef.slots;
14
- export default class AudioMediaAsset extends SvelteComponent<AudioMediaAssetProps, AudioMediaAssetEvents, AudioMediaAssetSlots> {
1
+ interface Props {
2
+ url: any;
15
3
  }
16
- export {};
4
+ declare const AudioMediaAsset: import("svelte").Component<Props, {}, "">;
5
+ type AudioMediaAsset = ReturnType<typeof AudioMediaAsset>;
6
+ export default AudioMediaAsset;
@@ -1,12 +1,19 @@
1
- <script>import { pushAsset } from "./images.js";
2
- import { onMount } from "svelte";
3
- export let url;
4
- let element;
5
- onMount(() => {
6
- if (!element)
7
- return;
8
- pushAsset(url, element);
9
- });
1
+ <script lang="ts">
2
+
3
+ import {pushAsset} from "./images.js";
4
+ import { onMount } from "svelte";
5
+ interface Props {
6
+ url: any;
7
+ }
8
+
9
+ let { url }: Props = $props();
10
+ let element = $state();
11
+
12
+ onMount(() => {
13
+ if (!element) return;
14
+ pushAsset(url, element);
15
+ })
16
+
10
17
  </script>
11
18
 
12
19
  <img src={url} alt="A Game Asset" bind:this={element} />
@@ -1,16 +1,6 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- url: any;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- };
11
- export type ImageAssetProps = typeof __propDef.props;
12
- export type ImageAssetEvents = typeof __propDef.events;
13
- export type ImageAssetSlots = typeof __propDef.slots;
14
- export default class ImageAsset extends SvelteComponent<ImageAssetProps, ImageAssetEvents, ImageAssetSlots> {
1
+ interface Props {
2
+ url: any;
15
3
  }
16
- export {};
4
+ declare const ImageAsset: import("svelte").Component<Props, {}, "">;
5
+ type ImageAsset = ReturnType<typeof ImageAsset>;
6
+ export default ImageAsset;
@@ -1,3 +1,3 @@
1
1
  export declare const pushBufferAsset: (url: string) => void;
2
2
  export declare const decodeAllBuffers: (context: AudioContext) => void;
3
- export declare const resolveBuffer: (url: string) => Promise<AudioBuffer | undefined>;
3
+ export declare const resolveBuffer: (url: string) => Promise<any>;
@@ -1,2 +1,2 @@
1
1
  export declare const pushAsset: (url: string, element: HTMLImageElement) => void;
2
- export declare const resolve: (url: string) => HTMLImageElement | undefined;
2
+ export declare const resolve: (url: string) => any;
@@ -1,20 +1,31 @@
1
- <script>import { jumpSignal, effectiveScene } from "./scenes.js";
2
- import { SvelteComponent, onMount } from "svelte";
3
- import { getTriggerLayerRender } from "../core-contexts.js";
4
- const triggerRender = getTriggerLayerRender();
5
- let scene;
6
- const changeScene = (_signal) => {
7
- scene = $effectiveScene;
8
- triggerRender();
9
- };
10
- $:
11
- changeScene($jumpSignal);
12
- onMount(() => {
13
- scene = $effectiveScene;
14
- });
15
- export let scenes = {};
1
+ <script lang="ts">
2
+
3
+ import {jumpSignal, effectiveScene} from "./scenes.js";
4
+ import {SvelteComponent, onMount} from "svelte";
5
+ import {getTriggerLayerRender} from "../core-contexts.js";
6
+
7
+ const triggerRender = getTriggerLayerRender();
8
+ let scene: string = $state();
9
+ const changeScene = (_signal: boolean) => {
10
+ scene = $effectiveScene;
11
+ triggerRender();
12
+ };
13
+
14
+ $effect(() => changeScene($jumpSignal));
15
+
16
+ onMount(() => {
17
+ scene = $effectiveScene;
18
+ });
19
+
20
+ interface Props {
21
+ scenes?: Record<string, typeof SvelteComponent<any,any,any>>;
22
+ }
23
+
24
+ let { scenes = {} }: Props = $props();
25
+
16
26
  </script>
17
27
 
18
28
  {#if scene && scenes[scene]}
19
- <svelte:component this={scenes[scene]}></svelte:component>
29
+ {@const SvelteComponent_1 = scenes[scene]}
30
+ <SvelteComponent_1 />
20
31
  {/if}
@@ -1,18 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- scenes?: Record<string, {
5
- new (options: import("svelte").ComponentConstructorOptions<any>): SvelteComponent<any, any, any>;
6
- }> | undefined;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type SceneSwitcherProps = typeof __propDef.props;
14
- export type SceneSwitcherEvents = typeof __propDef.events;
15
- export type SceneSwitcherSlots = typeof __propDef.slots;
16
- export default class SceneSwitcher extends SvelteComponent<SceneSwitcherProps, SceneSwitcherEvents, SceneSwitcherSlots> {
2
+ interface Props {
3
+ scenes?: Record<string, typeof SvelteComponent<any, any, any>>;
17
4
  }
18
- export {};
5
+ declare const SceneSwitcher: import("svelte").Component<Props, {}, "">;
6
+ type SceneSwitcher = ReturnType<typeof SceneSwitcher>;
7
+ export default SceneSwitcher;