Skip to content

Commit

Permalink
exports instead of module
Browse files Browse the repository at this point in the history
  • Loading branch information
smwhr committed May 22, 2024
1 parent 8f9d32a commit 763f703
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
41 changes: 41 additions & 0 deletions ink.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Story, InkList } from './engine/Story'
import { Compiler } from './compiler/Compiler'
import { CompilerOptions } from './compiler/CompilerOptions'
import { PosixFileHandler } from './compiler/FileHandler/PosixFileHandler'
import { JsonFileHandler } from './compiler/FileHandler/JsonFileHandler'

declare interface Inkjs {
/**
* A Story is the core class that represents a complete Ink narrative, and
* manages runtime evaluation and state.
*/
Story: typeof Story

/**
* The underlying type for a list item in Ink.
*/
InkList: typeof InkList

/**
* Compiles Ink stories from source.
*/
Compiler: typeof Compiler

/**
* Metadata options for a compiler pass.
*/
CompilerOptions: typeof CompilerOptions

/**
* Resolves and loads Ink sources from a POSIX filesystem.
*/
PosixFileHandler: typeof PosixFileHandler

/**
* Resolves and loads Ink sources from a JSON hierarchy.
*/
JsonFileHandler: typeof JsonFileHandler
}

declare let inkjs: Inkjs
export default inkjs
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
"description": "A javascript port of inkle's ink scripting language (http://www.inklestudios.com/ink/)",
"type": "commonjs",
"main": "dist/ink-full.js",
"module": "dist/ink-full.mjs",
"types": "ink.d.ts",
"files": ["src/engine","src/compiler","ink.d.ts","script/inkjs-compiler.ts"],
"files": ["src/engine","src/compiler","ink.d.ts", "ink.d.mts","script/inkjs-compiler.ts", "dist"],
"exports": {
".":{
"types": "./ink.d.mts",
"import": "./dist/ink.mjs",
"default": "./dist/ink.js"
},
"./full":{
"types": "./ink.d.mts",
"import": "./dist/ink-full.mjs",
"default": "./dist/ink-full.js"
}
},
"scripts": {
"test": "npm run test:typescript && npm run test:javascript",
"test:typescript": "jest",
Expand Down

0 comments on commit 763f703

Please sign in to comment.