Skip to content

Commit

Permalink
feat: support svelte types
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed May 20, 2023
1 parent fa62f35 commit a401a7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/svelte-guides/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-guides",
"version": "0.25.5",
"version": "0.25.6",
"description": "A Svelte Guides component that can draw ruler and manage guidelines.",
"svelte": "./src/index.js",
"sideEffects": false,
Expand Down
31 changes: 10 additions & 21 deletions packages/svelte-guides/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
import { GuidesInterface } from "@scena/guides";
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
import { GuidesInterface, GuidesOptions, GuidesEvents } from "@scena/guides";


interface ComponentOptions {
target: HTMLElement;
anchor?: HTMLElement | null;
props?: {};
hydrate?: boolean;
intro?: boolean;
export type SvelteGuidesEvents = {
[key in keyof GuidesEvents]: CustomEvent<GuidesEvents[key]>;
}
export default class GuidesComponent extends SvelteComponentTyped<
GuidesOptions,
SvelteGuidesEvents
> { }

interface GuidesComponent extends GuidesInterface {
new(options: ComponentOptions): any;
// client-side methods
$set(props: {}): void;
$on(event: string, callback: (event: CustomEvent) => void): void;
$destroy(): void;
// server-side methods
render(props?: {}): {
html: string;
css: { code: string; map: string | null };
head?: string;
};
export default interface GuidesComponent extends GuidesInterface {
}

export default GuidesComponent;
export * from "@scena/guides";

0 comments on commit a401a7a

Please sign in to comment.