From 1953633d085d274788a947ff2855c030cbaa7179 Mon Sep 17 00:00:00 2001 From: Dennis Zoma <3930150+wottpal@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:24:06 +0200 Subject: [PATCH 1/2] Added helper.d.ts File --- helper.d.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 helper.d.ts diff --git a/helper.d.ts b/helper.d.ts new file mode 100644 index 0000000..e5028fc --- /dev/null +++ b/helper.d.ts @@ -0,0 +1,34 @@ +/** + * To initialize nightwind, add the following script tag to the head element of your pages. + * + * ``` + * import nightwind from "nightwind/helper" + * + * export default function Layout() { + * return ( + * <> + *
+ * + * + * // ... + * > + * ) + * } + * ``` + */ + export declare function init(): string; + /** + * Similarly, you can use the toggle function to switch between dark and light mode. + * ``` + * import nightwind from "nightwind/helper" + * + * export default function Navbar() { + * return ( + * // ... + * + * // ... + * ) + * } + * ``` + */ + export declare function toggle(): void; \ No newline at end of file From dd368558578509da8a4a8aebf6f4b2b702dec942 Mon Sep 17 00:00:00 2001 From: Dennis Zoma <3930150+wottpal@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:37:12 +0200 Subject: [PATCH 2/2] Add declaration for `enable`-function --- helper.d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/helper.d.ts b/helper.d.ts index e5028fc..7a53ac1 100644 --- a/helper.d.ts +++ b/helper.d.ts @@ -31,4 +31,19 @@ * } * ``` */ - export declare function toggle(): void; \ No newline at end of file + export declare function toggle(): void; + /** + * You can use the enable function to specifically switch between dark and light mode. + * ``` + * import nightwind from "nightwind/helper" + * + * export default function Navbar() { + * return ( + * // ... + * + * // ... + * ) + * } + * ``` + */ + export declare function enable(dark: boolean): void; \ No newline at end of file