From 63e6eabda329b5f91ac44b1c46c6e692bf3f1ac8 Mon Sep 17 00:00:00 2001 From: Dahoom Date: Fri, 15 Nov 2024 20:42:22 +0300 Subject: [PATCH] add: refactor types to support exporting interface for GABRYCA implementation --- package.json | 4 ++-- types/SEO.svelte.d.ts | 20 ++++++++++++++++ SEO.svelte.d.ts => types/SEO.ts | 41 ++++----------------------------- 3 files changed, 26 insertions(+), 39 deletions(-) create mode 100644 types/SEO.svelte.d.ts rename SEO.svelte.d.ts => types/SEO.ts (59%) diff --git a/package.json b/package.json index fd5f98f..2ac5f89 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "sk-seo", - "version": "0.4.3", + "version": "0.4.4", "description": "A lightweight, no depenencies, Sveltekit SEO component to save your time", "main": "SEO.svelte", "exports": { ".": { - "types": "./SEO.svelte.d.ts", + "types": "./types/SEO.svelte.d.ts", "svelte": "./SEO.svelte" } }, diff --git a/types/SEO.svelte.d.ts b/types/SEO.svelte.d.ts new file mode 100644 index 0000000..e91c3c2 --- /dev/null +++ b/types/SEO.svelte.d.ts @@ -0,0 +1,20 @@ +/** @typedef {import('./SEO').SEOProps} SeoProps */ +/** @typedef {typeof __propDef.events} SeoEvents */ +/** @typedef {typeof __propDef.slots} SeoSlots */ +export default class Seo extends SvelteComponent; +}, {}> { +} +export type SeoProps = import('./SEO').SEOProps; +export type SeoEvents = typeof __propDef.events; +export type SeoSlots = typeof __propDef.slots; +//@ts-ignore +import { SvelteComponent } from "svelte"; +declare const __propDef: { + props: SeoProps; + events: { + [evt: string]: CustomEvent; + }; + slots: {}; +}; +export { SeoProps as SEOProps }; diff --git a/SEO.svelte.d.ts b/types/SEO.ts similarity index 59% rename from SEO.svelte.d.ts rename to types/SEO.ts index f226bc4..40a3412 100644 --- a/SEO.svelte.d.ts +++ b/types/SEO.ts @@ -1,7 +1,4 @@ -/** @typedef {typeof __propDef.props} SeoProps */ -/** @typedef {typeof __propDef.events} SeoEvents */ -/** @typedef {typeof __propDef.slots} SeoSlots */ -export default class Seo extends SvelteComponent<{ +export interface SEOProps { /** The title of the page.*/ title?: string; /** The description of the website.*/ @@ -35,36 +32,6 @@ export default class Seo extends SvelteComponent<{ socials?: string[]; /** The name to be used for SchemaOrg */ name?: string; -}, { - [evt: string]: CustomEvent; -}, {}> { -} -export type SeoProps = typeof __propDef.props; -export type SeoEvents = typeof __propDef.events; -export type SeoSlots = typeof __propDef.slots; -import { SvelteComponent } from "svelte"; -declare const __propDef: { - props: { - title?: string; - description?: string; - keywords?: string; - canonical?: string; - siteName?: string; - index?: boolean; - twitter?: boolean; - openGraph?: boolean; - schemaOrg?: boolean; - schemaType?: string; - jsonld?: {}; - imageURL?: string; - logo?: string; - author?: string; - socials?: string[]; - name?: string; - }; - events: { - [evt: string]: CustomEvent; - }; - slots: {}; -}; -export {}; + /** The type of the page */ + type?: string; +} \ No newline at end of file