Code Monkey home page Code Monkey logo

schemas's Introduction

Stream Deck SDK banner

Schemas

Schemas npm package SDK documentation Join the Marketplace Makers Discord Elgato homepage

Collection of schemas, and TypeScript declarations, to support the creation and validation of Stream Deck SDK files.

npm install @elgato/schemas

Stream Deck

Plugin

Manifest

Manifest JSON file responsible for defining a Stream Deck plugin.

// TypeScript type.
import { type Manifest } from "@elgato/schemas/streamdeck/plugins";
// Schema as an object.
import manifest from "@elgato/schemas/streamdeck/plugins/json";
// Schema as an object, with experimental import attributes
import manifest from "@elgato/schemas/streamdeck/plugins/manifest.json" with { type: "json" };
https://schemas.elgato.com/streamdeck/plugins/manifest.json

Layout

Layout JSON file that defines the layout of an action on Stream Deck +.

// TypeScript type.
import { type Layout } from "@elgato/schemas/streamdeck/plugins";
// Schema as an object.
import layout from "@elgato/schemas/streamdeck/plugins/json";
// Schema as an object, with experimental import attributes
import layout from "@elgato/schemas/streamdeck/plugins/layout.json" with { type: "json" };
https://schemas.elgato.com/streamdeck/plugins/layout.json

Usage

Schemas can be referenced directly within JSON files, providing intellisense and validation, using the $schema property, for example:

{
    "$schema": "https://schemas.elgato.com/streamdeck/plugins/manifest.json",
    "Name": "Wave Link",
    "Version": "1.9.0.0",
    "Author": "Elgato"
    // ...
}

Keywords

Custom keywords used within the provided schemas can also be directly imported to assist with constructing a validator, such as Ajv. Please note, the custom keyword definitions will only register the keyword, and will not provide validation.

import { keywordDefinitions } from "@elgato/schemas";
import Ajv from "ajv";

// add the "filePath" keyword (excluding validation)
ajv.addKeyword(keywordDefinitions.filePath);

schemas's People

Contributors

geekyeggo avatar

Stargazers

Gary Funk avatar Shugo Kawamura avatar

Watchers

Andy Fuchs avatar Elgato avatar  avatar Philipp Eggebrecht avatar Zack Hoherchak avatar Thomas Schnitzler avatar  avatar

schemas's Issues

FYI: The JSON Schema repo has a manifest.json schema to further help plugin devs

Hey, this repo looks really neat, and I'm excited to get to use the validate command to help check my plugins' manifests. I've been so looking forward to manifest validation like this that [I have previously submitted a manifest.json definition to the SchemaStore repository],(SchemaStore/schemastore#3562) complete with tests against publicly available plugin manifests.

That JSON Schema file is really useful when added to a manifest.json file directly, like in one of my plugins. That way, you end up with great IDE support:

Screenshot 2024-02-16 000114

(I'm not opening this as an issue for you to fix anything. I just thought you should know that it's a feature out there in the world that makes it easier for people to develop Stream Deck plugins. If you want to update the SchemaStore definition when you make changes to the manifest definition, even better. Feel free to close this after reading it.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.