Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write schema interface #371

Open
tim-evans opened this issue Jan 16, 2020 · 0 comments
Open

Write schema interface #371

tim-evans opened this issue Jan 16, 2020 · 0 comments
Labels
🎉 Feature A new feature or request

Comments

@tim-evans
Copy link
Collaborator

tim-evans commented Jan 16, 2020

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.

@tim-evans tim-evans added the 🎉 Feature A new feature or request label Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 Feature A new feature or request
Projects
None yet
Development

No branches or pull requests

1 participant