Skip to content

Provide TypeScript shim for Extension API #449

@cd-work

Description

@cd-work

Overview

The API functions exposed by Deno can be used from consumers using Deno.core.opAsync(..). This is somewhat awkward to use, doesn't provide any type safety and lacks solid documentation.

To make writing extensions as simple as possible, we should provide our own shim that translates the generic, unchecked Deno API to our custom TypeScript wrapper. Consumers should be able to just import this API and then use the functions provided by us, with a sensible module structure and method naming.

Acceptance Criteria

  • Phylum API TypeScript module is injected into the Deno runtime, for any extension to use
  • TypeScript shim maps each Extensions API function to a TypeScript function
  • Functions are documented, so the injected module can be used as preliminary documentation for writing extensions

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestextensionsPhylum CLI extensionsmedium priorityShould be handled as soon as possible

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions