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

JS client library and typings #28

Open
patdx opened this issue Feb 13, 2023 · 0 comments
Open

JS client library and typings #28

patdx opened this issue Feb 13, 2023 · 0 comments

Comments

@patdx
Copy link
Owner

patdx commented Feb 13, 2023

It could be interesting to provide a client library that can be used to do some simple operations. For example:

import { client } from '@patdx/edge-cms';

client.Posts.getById(1);

Though, in the spirit of keeping things simple, I would rather just have a predictable REST Api, like GET /posts/1, and provide some snippets/hints for typing it.

On the typing side, considering how Deno libraries provide d.ts declarations by HTTP request, maybe Edge CMS could pretend to be its own NPM repo or Deno package server, and serve some d.ts files directly to the app? Eg, in Deno, something like:

import type { Post } from 'https://edge-cms.pmil.workers.dev/types.ts';

Could automatically provide the Post type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant