Skip to content

Write schema interface #371

@tim-evans

Description

@tim-evans

Implement schema interface as decided in #311

Please include type "macros" for grabbing annotation names and annotation classes.
Given a schema:

import { Bold, Italic } from "@atjson/offset-annotations";
const MySchema = {
  annotations: {
    Bold,
    Italic
  }
};

The annotations name type should return a type of "Bold" | "Italic" and the annotations class type should return typeof Bold | typeof Italic.

You can reference the document-in-test branch on this repository for some examples of how to do this. Ask @tim-evans if you have questions on handling this via conditional types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🎉 FeatureA new feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions