@automataframework/shell 0.0.1-preview.17.sha-d17daef → 0.0.1
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/README.md +3 -0
- package/index.js +1 -0
- package/package.json +6 -50
- package/LICENSE +0 -21
- package/dist/features/error/error.d.ts +0 -5
- package/dist/features/flow/flow.d.ts +0 -37
- package/dist/features/formats/formats.d.ts +0 -185
- package/dist/features/host/host.d.ts +0 -50
- package/dist/features/hud/read-path.d.ts +0 -2
- package/dist/features/settings/settings.d.ts +0 -24
- package/dist/features/start/start.d.ts +0 -14
- package/dist/features/theme/css.d.ts +0 -11
- package/dist/features/theme/default.d.ts +0 -41
- package/dist/features/words/words.d.ts +0 -16
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -3381
- package/messages/en.json +0 -53
- package/messages/es.json +0 -53
package/README.md
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("@automataframework/shell isn't ready yet. See https://automataframework.com to hear when it is.")
|
package/package.json
CHANGED
|
@@ -1,54 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automataframework/shell",
|
|
3
|
-
"version": "0.0.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Not ready yet. See https://automataframework.com",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"author": "McThayDT",
|
|
7
6
|
"homepage": "https://automataframework.com",
|
|
8
|
-
"repository": {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public",
|
|
15
|
-
"provenance": true
|
|
16
|
-
},
|
|
17
|
-
"type": "module",
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"import": "./dist/index.js"
|
|
22
|
-
},
|
|
23
|
-
"./package.json": "./package.json"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"dist",
|
|
27
|
-
"messages"
|
|
28
|
-
],
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"svelte": "5.59.2",
|
|
31
|
-
"zod": "4.6.6",
|
|
32
|
-
"@automataframework/2d": "0.0.1-preview.17.sha-d17daef",
|
|
33
|
-
"@automataframework/core": "0.0.1-preview.17.sha-d17daef"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@fontsource-variable/bricolage-grotesque": "5.3.0",
|
|
37
|
-
"@fontsource-variable/figtree": "5.3.0",
|
|
38
|
-
"@inlang/paraglide-js": "2.25.4",
|
|
39
|
-
"@inlang/plugin-message-format": "4.4.4",
|
|
40
|
-
"@sveltejs/vite-plugin-svelte": "7.3.2",
|
|
41
|
-
"@typescript/native": "npm:typescript@7.0.2",
|
|
42
|
-
"svelte-check": "4.7.8",
|
|
43
|
-
"typescript": "6.0.3",
|
|
44
|
-
"vite": "8.4.0"
|
|
45
|
-
},
|
|
46
|
-
"engines": {
|
|
47
|
-
"node": ">=24"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "vite build && tsc -p tsconfig.build.json",
|
|
51
|
-
"check:svelte": "svelte-check --tsgo --tsconfig ./tsconfig.json",
|
|
52
|
-
"compile:words": "bun scripts/compile-words.ts"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
7
|
+
"repository": { "type": "git", "url": "git+https://github.com/AutomataFramework/AutomataFramework.git", "directory": "packages/shell" },
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"files": ["index.js", "README.md"]
|
|
10
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Automata Framework
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Screen } from '../formats/formats.ts';
|
|
2
|
-
/** The one screen the shell holds itself: what shows when the game's own code fails. Its words are the shell's. */
|
|
3
|
-
export declare const somethingWentWrong: Screen;
|
|
4
|
-
/** The built-in question the flow asks with `{ ask, yes }`: the question's word is the title, its `Body` the line under it. */
|
|
5
|
-
export declare function questionScreen(word: string, has: (name: string) => boolean): Screen;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Flow } from '../formats/formats.ts';
|
|
2
|
-
/** Where the player is: on a screen, playing, or being asked a question over either. */
|
|
3
|
-
export type Place = {
|
|
4
|
-
/** The flow's name for this state. */
|
|
5
|
-
at: string;
|
|
6
|
-
screen?: string | undefined;
|
|
7
|
-
hud?: string | undefined;
|
|
8
|
-
/** Set while a question is up: the word that asks it. */
|
|
9
|
-
asking?: string | undefined;
|
|
10
|
-
/** Milliseconds until `timeout` happens by itself, when this state says so. */
|
|
11
|
-
after?: number | undefined;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The flow file as a plain machine. An event moves the player from one state to the next by the state's `on`. `back`
|
|
15
|
-
* goes to where the player came from unless the state says otherwise. A target `{ ask, yes }` asks first: `ask-yes`
|
|
16
|
-
* goes on, `ask-no` (or `back`) stays. Built-in events are skip, timeout, new-game, continue, pause, resume, win,
|
|
17
|
-
* lose, retry and back; a flow may add its own.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createFlow(flow: Flow, options?: {
|
|
20
|
-
startPlaying?: boolean;
|
|
21
|
-
}): {
|
|
22
|
-
place: () => Place;
|
|
23
|
-
/** True when the event changed where the player is. */
|
|
24
|
-
send(event: string): boolean;
|
|
25
|
-
/** Goes straight to a named state, forgetting the way back. */
|
|
26
|
-
to(name: string): void;
|
|
27
|
-
/** Goes straight to the state that plays the game (a saved game being continued). */
|
|
28
|
-
play(): boolean;
|
|
29
|
-
/** True when the state handles this event. */
|
|
30
|
-
handles: (event: string) => boolean;
|
|
31
|
-
};
|
|
32
|
-
/** What is wrong with the flow's links to the other files, one plain sentence each. */
|
|
33
|
-
export declare function flowProblems(flow: Flow, screens: Set<string>, huds: Set<string>): {
|
|
34
|
-
name: string;
|
|
35
|
-
message: string;
|
|
36
|
-
fix: string;
|
|
37
|
-
}[];
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** The `screen` content kind. Formats may change. */
|
|
3
|
-
export declare const screenSchema: z.ZodObject<{
|
|
4
|
-
format: z.ZodLiteral<1>;
|
|
5
|
-
id: z.ZodString;
|
|
6
|
-
kind: z.ZodLiteral<"screen">;
|
|
7
|
-
title: z.ZodOptional<z.ZodString>;
|
|
8
|
-
above: z.ZodOptional<z.ZodString>;
|
|
9
|
-
layout: z.ZodOptional<z.ZodEnum<{
|
|
10
|
-
card: "card";
|
|
11
|
-
splash: "splash";
|
|
12
|
-
}>>;
|
|
13
|
-
back: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
-
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
-
type: z.ZodLiteral<"button">;
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
label: z.ZodString;
|
|
18
|
-
does: z.ZodString;
|
|
19
|
-
main: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
-
opens: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
shows: z.ZodOptional<z.ZodLiteral<"language">>;
|
|
22
|
-
when: z.ZodOptional<z.ZodEnum<{
|
|
23
|
-
"has-save": "has-save";
|
|
24
|
-
"no-save": "no-save";
|
|
25
|
-
}>>;
|
|
26
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
type: z.ZodLiteral<"text">;
|
|
28
|
-
words: z.ZodString;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"image">;
|
|
31
|
-
asset: z.ZodString;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
type: z.ZodLiteral<"slider">;
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
label: z.ZodString;
|
|
36
|
-
setting: z.ZodEnum<{
|
|
37
|
-
contrast: "contrast";
|
|
38
|
-
effects: "effects";
|
|
39
|
-
frameCounter: "frameCounter";
|
|
40
|
-
language: "language";
|
|
41
|
-
master: "master";
|
|
42
|
-
motion: "motion";
|
|
43
|
-
music: "music";
|
|
44
|
-
mute: "mute";
|
|
45
|
-
textSize: "textSize";
|
|
46
|
-
}>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
type: z.ZodLiteral<"steps">;
|
|
49
|
-
id: z.ZodString;
|
|
50
|
-
label: z.ZodString;
|
|
51
|
-
setting: z.ZodEnum<{
|
|
52
|
-
contrast: "contrast";
|
|
53
|
-
effects: "effects";
|
|
54
|
-
frameCounter: "frameCounter";
|
|
55
|
-
language: "language";
|
|
56
|
-
master: "master";
|
|
57
|
-
motion: "motion";
|
|
58
|
-
music: "music";
|
|
59
|
-
mute: "mute";
|
|
60
|
-
textSize: "textSize";
|
|
61
|
-
}>;
|
|
62
|
-
levels: z.ZodArray<z.ZodString>;
|
|
63
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
-
type: z.ZodLiteral<"switch">;
|
|
65
|
-
id: z.ZodString;
|
|
66
|
-
label: z.ZodString;
|
|
67
|
-
setting: z.ZodEnum<{
|
|
68
|
-
contrast: "contrast";
|
|
69
|
-
effects: "effects";
|
|
70
|
-
frameCounter: "frameCounter";
|
|
71
|
-
language: "language";
|
|
72
|
-
master: "master";
|
|
73
|
-
motion: "motion";
|
|
74
|
-
music: "music";
|
|
75
|
-
mute: "mute";
|
|
76
|
-
textSize: "textSize";
|
|
77
|
-
}>;
|
|
78
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
-
type: z.ZodLiteral<"list">;
|
|
80
|
-
from: z.ZodEnum<{
|
|
81
|
-
controls: "controls";
|
|
82
|
-
credits: "credits";
|
|
83
|
-
languages: "languages";
|
|
84
|
-
saves: "saves";
|
|
85
|
-
}>;
|
|
86
|
-
}, z.core.$strip>], "type">>;
|
|
87
|
-
}, z.core.$loose>;
|
|
88
|
-
/** The `hud` content kind. Formats may change. */
|
|
89
|
-
export declare const hudSchema: z.ZodObject<{
|
|
90
|
-
format: z.ZodLiteral<1>;
|
|
91
|
-
id: z.ZodString;
|
|
92
|
-
kind: z.ZodLiteral<"hud">;
|
|
93
|
-
items: z.ZodArray<z.ZodObject<{
|
|
94
|
-
type: z.ZodEnum<{
|
|
95
|
-
bar: "bar";
|
|
96
|
-
icon: "icon";
|
|
97
|
-
text: "text";
|
|
98
|
-
}>;
|
|
99
|
-
shows: z.ZodString;
|
|
100
|
-
label: z.ZodString;
|
|
101
|
-
where: z.ZodEnum<{
|
|
102
|
-
bottom: "bottom";
|
|
103
|
-
"bottom-left": "bottom-left";
|
|
104
|
-
"bottom-right": "bottom-right";
|
|
105
|
-
top: "top";
|
|
106
|
-
"top-left": "top-left";
|
|
107
|
-
"top-right": "top-right";
|
|
108
|
-
}>;
|
|
109
|
-
player: z.ZodOptional<z.ZodNumber>;
|
|
110
|
-
}, z.core.$strip>>;
|
|
111
|
-
}, z.core.$loose>;
|
|
112
|
-
/** The `flow` content kind. A state shows a screen, or plays the game and shows a HUD. Formats may change. */
|
|
113
|
-
export declare const flowSchema: z.ZodObject<{
|
|
114
|
-
format: z.ZodLiteral<1>;
|
|
115
|
-
id: z.ZodString;
|
|
116
|
-
kind: z.ZodLiteral<"flow">;
|
|
117
|
-
start: z.ZodString;
|
|
118
|
-
screens: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
119
|
-
screen: z.ZodOptional<z.ZodString>;
|
|
120
|
-
hud: z.ZodOptional<z.ZodString>;
|
|
121
|
-
after: z.ZodOptional<z.ZodNumber>;
|
|
122
|
-
on: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
123
|
-
ask: z.ZodString;
|
|
124
|
-
yes: z.ZodString;
|
|
125
|
-
}, z.core.$strip>]>>;
|
|
126
|
-
}, z.core.$strip>>;
|
|
127
|
-
}, z.core.$loose>;
|
|
128
|
-
/** The `theme` content kind. Every key is optional: a missing one takes the shell's own look. Formats may change. */
|
|
129
|
-
export declare const themeSchema: z.ZodObject<{
|
|
130
|
-
format: z.ZodLiteral<1>;
|
|
131
|
-
id: z.ZodString;
|
|
132
|
-
kind: z.ZodLiteral<"theme">;
|
|
133
|
-
colours: z.ZodOptional<z.ZodObject<{
|
|
134
|
-
page: z.ZodOptional<z.ZodString>;
|
|
135
|
-
words: z.ZodOptional<z.ZodString>;
|
|
136
|
-
muted: z.ZodOptional<z.ZodString>;
|
|
137
|
-
button: z.ZodOptional<z.ZodString>;
|
|
138
|
-
buttonWords: z.ZodOptional<z.ZodString>;
|
|
139
|
-
primary: z.ZodOptional<z.ZodString>;
|
|
140
|
-
primaryWords: z.ZodOptional<z.ZodString>;
|
|
141
|
-
line: z.ZodOptional<z.ZodString>;
|
|
142
|
-
focus: z.ZodOptional<z.ZodString>;
|
|
143
|
-
player: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
144
|
-
}, z.core.$strip>>;
|
|
145
|
-
fonts: z.ZodOptional<z.ZodObject<{
|
|
146
|
-
title: z.ZodOptional<z.ZodString>;
|
|
147
|
-
main: z.ZodOptional<z.ZodString>;
|
|
148
|
-
plain: z.ZodOptional<z.ZodString>;
|
|
149
|
-
}, z.core.$strip>>;
|
|
150
|
-
corners: z.ZodOptional<z.ZodObject<{
|
|
151
|
-
card: z.ZodOptional<z.ZodObject<{
|
|
152
|
-
size: z.ZodNumber;
|
|
153
|
-
steep: z.ZodNumber;
|
|
154
|
-
}, z.core.$strip>>;
|
|
155
|
-
button: z.ZodOptional<z.ZodObject<{
|
|
156
|
-
size: z.ZodNumber;
|
|
157
|
-
steep: z.ZodNumber;
|
|
158
|
-
}, z.core.$strip>>;
|
|
159
|
-
small: z.ZodOptional<z.ZodObject<{
|
|
160
|
-
size: z.ZodNumber;
|
|
161
|
-
steep: z.ZodNumber;
|
|
162
|
-
}, z.core.$strip>>;
|
|
163
|
-
}, z.core.$strip>>;
|
|
164
|
-
outline: z.ZodOptional<z.ZodNumber>;
|
|
165
|
-
pixelArt: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
-
playerMarks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
167
|
-
}, z.core.$loose>;
|
|
168
|
-
/** The `credits` content kind. Formats may change. */
|
|
169
|
-
export declare const creditsSchema: z.ZodObject<{
|
|
170
|
-
format: z.ZodLiteral<1>;
|
|
171
|
-
id: z.ZodString;
|
|
172
|
-
kind: z.ZodLiteral<"credits">;
|
|
173
|
-
lines: z.ZodArray<z.ZodObject<{
|
|
174
|
-
role: z.ZodString;
|
|
175
|
-
names: z.ZodArray<z.ZodString>;
|
|
176
|
-
}, z.core.$strip>>;
|
|
177
|
-
}, z.core.$loose>;
|
|
178
|
-
export type Screen = z.infer<typeof screenSchema>;
|
|
179
|
-
export type Item = Screen['items'][number];
|
|
180
|
-
export type Hud = z.infer<typeof hudSchema>;
|
|
181
|
-
export type Flow = z.infer<typeof flowSchema>;
|
|
182
|
-
export type Theme = z.infer<typeof themeSchema>;
|
|
183
|
-
export type Credits = z.infer<typeof creditsSchema>;
|
|
184
|
-
/** Teaches `/core` the shell's content kinds, so a mistake in one of its files is named with its file and line. */
|
|
185
|
-
export declare function defineShellKinds(): void;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Readable } from 'svelte/store';
|
|
2
|
-
import type { Credits, Screen } from '../formats/formats.ts';
|
|
3
|
-
import type { Look } from '../theme/default.ts';
|
|
4
|
-
import type { SettingName, Settings } from '../settings/settings.ts';
|
|
5
|
-
/** One row of the saves list. */
|
|
6
|
-
type SaveRow = {
|
|
7
|
-
slot: string;
|
|
8
|
-
empty: boolean;
|
|
9
|
-
savedAt: number;
|
|
10
|
-
};
|
|
11
|
-
/** One row of the controls list: what it does, and the key that does it. */
|
|
12
|
-
type ControlRow = {
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
key: string;
|
|
16
|
-
};
|
|
17
|
-
/** Everything a screen's parts need from the game around them. Handed down with Svelte's context under `host`. */
|
|
18
|
-
export type Host = {
|
|
19
|
-
/** A word by its message name, in the language now chosen. A new function whenever the language changes. */
|
|
20
|
-
t: Readable<(name: string, inputs?: Record<string, unknown>) => string>;
|
|
21
|
-
settings: Readable<Settings>;
|
|
22
|
-
set<K extends SettingName>(name: K, value: Settings[K]): void;
|
|
23
|
-
send(event: string): void;
|
|
24
|
-
hasSave: Readable<boolean>;
|
|
25
|
-
languages: string[];
|
|
26
|
-
look: Look;
|
|
27
|
-
/** The width of the stage, in px: under 600 the card is a sheet. */
|
|
28
|
-
stageWidth: Readable<number>;
|
|
29
|
-
setStageWidth(width: number): void;
|
|
30
|
-
/** Keys were used (or, with `false`, a finger or mouse): a screen takes focus only for the keys. */
|
|
31
|
-
noteKeyboard(on?: boolean): void;
|
|
32
|
-
saves(): SaveRow[];
|
|
33
|
-
controls(): ControlRow[];
|
|
34
|
-
credits(): Credits | undefined;
|
|
35
|
-
assetUrl(id: string): string | undefined;
|
|
36
|
-
};
|
|
37
|
-
/** What the shell shows right now. */
|
|
38
|
-
export type View = {
|
|
39
|
-
kind: 'none';
|
|
40
|
-
} | {
|
|
41
|
-
kind: 'screen';
|
|
42
|
-
screen: Screen;
|
|
43
|
-
asking?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
kind: 'ask';
|
|
46
|
-
word: string;
|
|
47
|
-
} | {
|
|
48
|
-
kind: 'play';
|
|
49
|
-
};
|
|
50
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { KeyValue } from '@automataframework/core';
|
|
2
|
-
/** What a player can change. Each `setting` a screen file names is one of these keys. */
|
|
3
|
-
export type Settings = {
|
|
4
|
-
language: string;
|
|
5
|
-
master: number;
|
|
6
|
-
music: number;
|
|
7
|
-
effects: number;
|
|
8
|
-
mute: boolean;
|
|
9
|
-
textSize: number;
|
|
10
|
-
contrast: number;
|
|
11
|
-
motion: number;
|
|
12
|
-
frameCounter: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type SettingName = keyof Settings;
|
|
15
|
-
/**
|
|
16
|
-
* The player's settings, kept in the browser under `automata:<game id>:settings`. A first visit takes the language the
|
|
17
|
-
* browser asks for, when the game has it. A value of the wrong kind in storage is thrown away, never trusted.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createSettings(store: KeyValue, gameId: string, languages: string[], browserLanguages: readonly string[]): {
|
|
20
|
-
all: () => Settings;
|
|
21
|
-
get: <K extends SettingName>(name: K) => Settings[K];
|
|
22
|
-
set<K extends SettingName>(name: K, value: Settings[K]): void;
|
|
23
|
-
subscribe(listener: (settings: Settings) => void): () => void;
|
|
24
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Game } from '@automataframework/core';
|
|
2
|
-
import { type Messages } from '../words/words.ts';
|
|
3
|
-
export type StartOptions = {
|
|
4
|
-
/** Where the game goes. The whole page by default. */
|
|
5
|
-
root?: HTMLElement;
|
|
6
|
-
/** The game's own words, compiled by Paraglide: `import * as messages from './paraglide/messages.js'`. */
|
|
7
|
-
messages?: Messages;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* The whole of a game's main file: loads the game's files, draws its screens from them over the canvas, and plays it.
|
|
11
|
-
* A mistake in a file is written on the page and no game starts. `window.__automata` is there from the start, and
|
|
12
|
-
* `ready` is true once the first frame is on the screen.
|
|
13
|
-
*/
|
|
14
|
-
export declare function startGame<G>(game: Game<G>, options?: StartOptions): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Look } from './default.ts';
|
|
2
|
-
/** The theme as CSS custom properties for the shell's root. No component holds a colour or a font of its own. */
|
|
3
|
-
export declare function cssVars(look: Look): Record<string, string>;
|
|
4
|
-
/** Registers each font asset under its asset id, so a theme may name it in `fonts`. */
|
|
5
|
-
export declare function registerFonts(assets: {
|
|
6
|
-
id: string;
|
|
7
|
-
kind: string;
|
|
8
|
-
path: string;
|
|
9
|
-
}[], fonts: {
|
|
10
|
-
add(face: FontFace): void;
|
|
11
|
-
}): Promise<void>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '../formats/formats.ts';
|
|
2
|
-
/** What a game with no theme file looks like: the light Soft look with crisp corners. Code, not a content file. */
|
|
3
|
-
export declare const softLook: {
|
|
4
|
-
colours: {
|
|
5
|
-
page: string;
|
|
6
|
-
words: string;
|
|
7
|
-
muted: string;
|
|
8
|
-
button: string;
|
|
9
|
-
buttonWords: string;
|
|
10
|
-
primary: string;
|
|
11
|
-
primaryWords: string;
|
|
12
|
-
line: string;
|
|
13
|
-
focus: string;
|
|
14
|
-
player: string[];
|
|
15
|
-
};
|
|
16
|
-
fonts: {
|
|
17
|
-
title: string;
|
|
18
|
-
main: string;
|
|
19
|
-
plain: string;
|
|
20
|
-
};
|
|
21
|
-
corners: {
|
|
22
|
-
card: {
|
|
23
|
-
size: number;
|
|
24
|
-
steep: number;
|
|
25
|
-
};
|
|
26
|
-
button: {
|
|
27
|
-
size: number;
|
|
28
|
-
steep: number;
|
|
29
|
-
};
|
|
30
|
-
small: {
|
|
31
|
-
size: number;
|
|
32
|
-
steep: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
outline: number;
|
|
36
|
-
pixelArt: boolean;
|
|
37
|
-
playerMarks: string[];
|
|
38
|
-
};
|
|
39
|
-
export type Look = typeof softLook;
|
|
40
|
-
/** A theme file laid over the Soft look: every key it leaves out stays as it was. */
|
|
41
|
-
export declare function lookOf(theme: Theme | undefined): Look;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type Messages = Record<string, unknown>;
|
|
2
|
-
/** A language written in its own words: "English", "Español". */
|
|
3
|
-
export declare function languageName(code: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Looks a word up by its message name in the language now chosen: first in the game's own words, then in the shell's.
|
|
6
|
-
* Paraglide gives the English words wherever a language has none, so a missing word is never blank. A name nobody wrote
|
|
7
|
-
* comes back as the name itself (or the plain text the game gave for it, such as its name); `automata check` names that file and word before a game ships.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createWords(sources: {
|
|
10
|
-
game?: Messages | undefined;
|
|
11
|
-
shell: Messages;
|
|
12
|
-
plain?: Record<string, string>;
|
|
13
|
-
}, language: () => string): {
|
|
14
|
-
word(name: string, inputs?: Record<string, unknown>): string;
|
|
15
|
-
has: (name: string) => boolean;
|
|
16
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { startGame } from './features/start/start.ts';
|
|
2
|
-
export type { StartOptions } from './features/start/start.ts';
|
|
3
|
-
export { creditsSchema, flowSchema, hudSchema, screenSchema, themeSchema } from './features/formats/formats.ts';
|
|
4
|
-
export type { Credits, Flow, Hud, Screen, Theme } from './features/formats/formats.ts';
|
|
5
|
-
export { softLook } from './features/theme/default.ts';
|
|
6
|
-
export type { Settings } from './features/settings/settings.ts';
|