Skip to content

JS client library and typings #28

@patdx

Description

@patdx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions