TypeScript definitions for the stremio-core Rust project.
Auto-generated using ts-rs and various scripts.
Using Bun:
bun add stremio-typesUsing npm:
npm i stremio-typesimport type { MetaItem } from "stremio-types";
const item: MetaItem = {
// Full autocompletion and type safety
};Every string union from the Rust core is transformed into a const array with an associated Type Guard.
import { ExtraTypes, isExtraType } from "stremio-types";
// Access the list of valid values
console.log(ExtraTypes);
// Validate an unknown string
const input = "search";
if (isExtraType(input)) {
// 'input' is now narrowed to ExtraType
console.log(`System is ${input}`);
}Clone the stremio-core repository and apply the patch:
bun run setupTo test against the latest stremio-core upstream tag:
bun run setup --latestGenerate types and build the package:
bun run buildThis will:
- Run cargo tests to export TypeScript bindings from stremio-core
- Process and clean up the generated types
- Build the distribution files
- Save any changes as a patch file
GitHub Actions can handle upstream syncs and publishing automatically.
.github/workflows/sync-upstream.ymlchecks for newstremio-core-web-v*tags on a schedule or manual dispatch.- When a new upstream release exists, it regenerates the types, updates
package.json, writes the new patch file, and commits the generated changes back tomain. .github/workflows/release.ymlhandles the tag creation and npm publish step, either from a direct manual version bump or after the sync workflow completes successfully.
See LICENSE
SPDX-License-Identifier: MIT