-
-
Notifications
You must be signed in to change notification settings - Fork 2
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
Summary
Request to add TypeScript type definitions to the JavaScript package for better developer experience.
Background
When building links-queue, we use TypeScript for better type safety and developer tooling. Having TypeScript definitions for links-notation would enable:
- IntelliSense/autocomplete in editors
- Compile-time type checking
- Better documentation of API through types
Desired Types
// Example of what would be helpful
export interface Link {
id?: number;
source: LinkRef;
target: LinkRef;
}
export type LinkRef = number | string | Link;
export interface ParseOptions {
strict?: boolean;
}
export interface FormatOptions {
pretty?: boolean;
indent?: string;
}
export function parse(notation: string, options?: ParseOptions): Link[];
export function format(links: Link | Link[], options?: FormatOptions): string;Workaround
Currently, we can create local type definitions, but having official types would be better maintained and accurate.
References
- links-queue issue #16 - Links Notation integration
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentation