Skip to content

Commit c010453

Browse files
authored
Merge branch 'upgrade/ts-5.0' into typescript-upgrade
2 parents a632f78 + e8625fb commit c010453

17 files changed

+11389
-717
lines changed

.github/workflows/checks.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4
1212
- name: Install node
13-
uses: actions/setup-node@v1
13+
uses: actions/setup-node@v4
1414
with:
15-
node-version: 16
15+
node-version: 20
1616
- name: Install dependencies
1717
run: npm install
1818
- name: Install codecov

.github/workflows/npm-manual-publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
test:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v1
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 16
15+
node-version: 20
1616
- run: npm install
1717
- run: npm run lint
1818
- run: npm run build
@@ -23,11 +23,11 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727
- name: Install node
28-
uses: actions/setup-node@v2
28+
uses: actions/setup-node@v4
2929
with:
30-
node-version: "16.x"
30+
node-version: "20.x"
3131
registry-url: "https://registry.npmjs.org"
3232
- name: Install dependencies
3333
run: npm install

.github/workflows/npm-publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 16
17+
node-version: 20
1818
- run: npm install
1919
- run: npm run lint
2020
- run: npm run build
@@ -25,11 +25,11 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v4
2929
- name: Install node
30-
uses: actions/setup-node@v2
30+
uses: actions/setup-node@v4
3131
with:
32-
node-version: "16.x"
32+
node-version: "20.x"
3333
registry-url: "https://registry.npmjs.org"
3434
- name: Install dependencies
3535
run: npm install

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ var result = EvaluateFunction('my_ink_function', ['arg1', 'arg2'], true);
140140
As this library is a port from C#, it requires a less standard way to assign the `Story` class, including all other classes, to a variable:
141141

142142
```ts
143-
import { Story, Compiler } from 'inkjs';
143+
import { Story } from 'inkjs';
144+
import { Compiler } from 'inkjs/full'; // Compiler is not provided in the default inkjs package
144145

145146
let story: InstanceType<typeof Story>;
146147
let compiler: InstanceType<typeof Compiler>;
@@ -149,7 +150,7 @@ let compiler: InstanceType<typeof Compiler>;
149150
Further, to minimize the verbose assignment, you can also create aliases in your project:
150151

151152
```ts
152-
import { Story, Compiler } from 'inkjs';
153+
import { Story, Compiler } from 'inkjs/full'; // Story is also provided in the "full" subpackage.
153154

154155
export type InkStory = InstanceType<typeof Story>;
155156
export type InkCompiler= InstanceType<typeof Compiler>;

ink.d.mts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { Story, InkList } from './engine/Story'
2+
import { Compiler } from './compiler/Compiler'
3+
import { CompilerOptions } from './compiler/CompilerOptions'
4+
import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler'
5+
import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler'
6+
7+
declare interface Inkjs {
8+
/**
9+
* A Story is the core class that represents a complete Ink narrative, and
10+
* manages runtime evaluation and state.
11+
*/
12+
Story: typeof Story
13+
14+
/**
15+
* The underlying type for a list item in Ink.
16+
*/
17+
InkList: typeof InkList
18+
19+
/**
20+
* Compiles Ink stories from source.
21+
*/
22+
Compiler: typeof Compiler
23+
24+
/**
25+
* Metadata options for a compiler pass.
26+
*/
27+
CompilerOptions: typeof CompilerOptions
28+
29+
/**
30+
* Resolves and loads Ink sources from a POSIX filesystem.
31+
*/
32+
PosixFileHandler: typeof PosixFileHandler
33+
34+
/**
35+
* Resolves and loads Ink sources from a JSON hierarchy.
36+
*/
37+
JsonFileHandler: typeof JsonFileHandler
38+
}
39+
40+
declare let inkjs: Inkjs
41+
export default inkjs

ink.d.ts

+29-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
import { Story, InkList } from './src/engine/Story'
2-
import { Compiler } from './src/compiler/Compiler'
3-
import { CompilerOptions } from './src/compiler/CompilerOptions'
4-
import { PosixFileHandler } from './src/compiler/FileHandler/PosixFileHandler'
5-
import { JsonFileHandler } from './src/compiler/FileHandler/JsonFileHandler'
1+
import { Story, InkList } from './engine/Story'
2+
import { Compiler } from './compiler/Compiler'
3+
import { CompilerOptions } from './compiler/CompilerOptions'
4+
import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler'
5+
import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler'
66

77
declare interface Inkjs {
8+
/**
9+
* A Story is the core class that represents a complete Ink narrative, and
10+
* manages runtime evaluation and state.
11+
*/
812
Story: typeof Story
13+
14+
/**
15+
* The underlying type for a list item in Ink.
16+
*/
917
InkList: typeof InkList
18+
19+
/**
20+
* Compiles Ink stories from source.
21+
*/
1022
Compiler: typeof Compiler
23+
24+
/**
25+
* Metadata options for a compiler pass.
26+
*/
1127
CompilerOptions: typeof CompilerOptions
28+
29+
/**
30+
* Resolves and loads Ink sources from a POSIX filesystem.
31+
*/
1232
PosixFileHandler: typeof PosixFileHandler
33+
34+
/**
35+
* Resolves and loads Ink sources from a JSON hierarchy.
36+
*/
1337
JsonFileHandler: typeof JsonFileHandler
1438
}
1539

0 commit comments

Comments
 (0)