diff --git a/.gitignore b/.gitignore
index 9508382..24c4cf0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,7 @@ junit-vitest.xml
!.trunk/
+/docs/static/social-cards
+docs/static/og-default.png
+docs/static/twitter-default.png
+mprocs.log
diff --git a/.ncuskip b/.ncuskip
index 7381a9a..e69de29 100644
--- a/.ncuskip
+++ b/.ncuskip
@@ -1,4 +0,0 @@
-
-# Eslint went thru a major version bump, so we need to skip it
-eslint
-@eslint/js
\ No newline at end of file
diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml
index a6e7da2..ceeae38 100644
--- a/.trunk/trunk.yaml
+++ b/.trunk/trunk.yaml
@@ -7,7 +7,7 @@ cli:
plugins:
sources:
- id: trunk
- ref: v1.7.4
+ ref: v1.7.5
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
@@ -17,18 +17,23 @@ runtimes:
- python@3.10.8
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
+ ignore:
+ - linters: [ALL]
+ paths:
+ - '**/worker-configuration.d.ts'
+ - convex/_generated/**
enabled:
- shellcheck@0.11.0
- shfmt@3.6.0
- - actionlint@1.7.10
- - checkov@3.2.501
- - eslint@9.39.2
+ - actionlint@1.7.11
+ - checkov@3.2.506
+ - eslint@10.0.2
- git-diff-check
- - markdownlint@0.47.0
+ - markdownlint@0.48.0
- osv-scanner@2.3.3
- prettier@3.8.1
- - svgo@4.0.0
- - trufflehog@3.93.3
+ - svgo@4.0.1
+ - trufflehog@3.93.7
- yamllint@1.38.0
actions:
disabled:
diff --git a/LICENSE b/LICENSE
index 1af7168..5da975e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2024-2025 Humanspeak, Inc.
+Copyright (c) 2024-2026 Humanspeak, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/docs/.ncuskip b/docs/.ncuskip
index 7381a9a..e69de29 100644
--- a/docs/.ncuskip
+++ b/docs/.ncuskip
@@ -1,4 +0,0 @@
-
-# Eslint went thru a major version bump, so we need to skip it
-eslint
-@eslint/js
\ No newline at end of file
diff --git a/docs/eslint.config.mjs b/docs/eslint.config.mjs
index 9c11a9e..43d651b 100644
--- a/docs/eslint.config.mjs
+++ b/docs/eslint.config.mjs
@@ -3,10 +3,12 @@ import js from '@eslint/js'
import prettier from 'eslint-config-prettier'
import svelte from 'eslint-plugin-svelte'
import globals from 'globals'
+import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import ts from 'typescript-eslint'
const gitignorePath = fileURLToPath(new URL('../.gitignore', import.meta.url))
+const tsconfigRootDir = dirname(fileURLToPath(import.meta.url))
export default [
includeIgnoreFile(gitignorePath),
@@ -32,6 +34,9 @@ export default [
globals: {
...globals.browser,
...globals.node
+ },
+ parserOptions: {
+ tsconfigRootDir
}
},
rules: {
diff --git a/docs/package.json b/docs/package.json
index 7ecee51..df8a436 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -4,59 +4,63 @@
"private": true,
"type": "module",
"scripts": {
- "build": "vite build",
+ "build": "tsx ./scripts/fetch-github-stats.ts && node ./scripts/generate-sitemap-manifest.mjs && tsx ./scripts/generate-social-cards.ts && vite build",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"deploy": "npm run build && wrangler pages deploy",
"dev": "vite dev",
+ "generate-social": "tsx ./scripts/generate-social-cards.ts",
"sitemap:manifest": "node ./scripts/generate-sitemap-manifest.mjs",
"sitemap:watch": "chokidar 'src/routes/**/*.svelte' 'src/routes/**/*.svx' 'src/routes/**/*.md' --ignore 'src/routes/examples/+page.ts' -c 'node ./scripts/generate-sitemap-manifest.mjs' --initial --silent",
+ "social:watch": "chokidar 'src/lib/components/OG.svelte' 'scripts/generate-social-cards.ts' -c 'tsx ./scripts/generate-social-cards.ts' --initial --silent",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"lint:fix": "npm run format && eslint . --fix",
"preview": "vite preview"
},
"dependencies": {
+ "@humanspeak/docs-kit": "github:humanspeak/docs-kit#2026.3.11",
"@humanspeak/memory-cache": "workspace:*",
"github-slugger": "^2.0.0",
"runed": "^0.37.1"
},
"devDependencies": {
- "@cloudflare/workers-types": "^4.20260217.0",
+ "@cloudflare/workers-types": "^4.20260301.1",
"@eslint/compat": "^2.0.2",
- "@eslint/js": "^9.39.2",
- "@humanspeak/svelte-motion": "^0.1.21",
- "@sveltejs/adapter-cloudflare": "^7.2.7",
- "@sveltejs/kit": "^2.52.0",
+ "@eslint/js": "^10.0.1",
+ "@humanspeak/svelte-motion": "^0.1.31",
+ "@sveltejs/adapter-cloudflare": "^7.2.8",
+ "@sveltejs/kit": "^2.53.4",
"@sveltejs/vite-plugin-svelte": "^6.2.4",
- "@tailwindcss/postcss": "^4.1.18",
+ "@tailwindcss/postcss": "^4.2.1",
"@tailwindcss/typography": "^0.5.19",
- "@tailwindcss/vite": "^4.1.18",
- "@typescript-eslint/eslint-plugin": "^8.56.0",
- "@typescript-eslint/parser": "^8.56.0",
- "autoprefixer": "^10.4.24",
+ "@tailwindcss/vite": "^4.2.1",
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
+ "@typescript-eslint/parser": "^8.56.1",
+ "autoprefixer": "^10.4.27",
"chokidar-cli": "^3.0.0",
- "eslint": "^9.39.2",
+ "eslint": "^10.0.2",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-svelte": "3.15.0",
- "globals": "^17.3.0",
- "lucide-svelte": "^0.574.0",
+ "globals": "^17.4.0",
+ "@lucide/svelte": "^0.577.0",
"mdsvex": "^0.12.6",
"mode-watcher": "^1.1.0",
"prettier": "^3.8.1",
"prettier-plugin-organize-imports": "^4.3.0",
"prettier-plugin-sort-json": "^4.2.0",
- "prettier-plugin-svelte": "^3.4.1",
+ "prettier-plugin-svelte": "^3.5.1",
"prettier-plugin-tailwindcss": "^0.7.2",
- "shiki": "^3.22.0",
- "svelte": "^5.51.3",
- "svelte-check": "^4.4.0",
- "tailwind-merge": "^3.4.1",
- "tailwindcss": "^4.1.18",
+ "shiki": "^4.0.1",
+ "svelte": "^5.53.7",
+ "svelte-check": "^4.4.4",
+ "tailwind-merge": "^3.5.0",
+ "tailwindcss": "^4.2.1",
+ "tsx": "^4.21.0",
"typescript": "^5.9.3",
- "typescript-eslint": "^8.56.0",
+ "typescript-eslint": "^8.56.1",
"vite": "^7.3.1",
- "wrangler": "^4.66.0"
+ "wrangler": "^4.70.0"
},
"volta": {
"node": "24.13.0"
diff --git a/docs/scripts/fetch-github-stats.ts b/docs/scripts/fetch-github-stats.ts
new file mode 100644
index 0000000..cbb47cc
--- /dev/null
+++ b/docs/scripts/fetch-github-stats.ts
@@ -0,0 +1,12 @@
+import { fetchGitHubStats } from '@humanspeak/docs-kit/scripts/fetch-github-stats'
+import path from 'path'
+import { fileURLToPath } from 'url'
+import { docsConfig } from '../src/lib/docs-config'
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
+
+await fetchGitHubStats({
+ repo: docsConfig.repo,
+ fallbackStars: docsConfig.fallbackStars,
+ outputPath: path.resolve(__dirname, '..', 'src', 'lib', 'github-stats.json')
+})
diff --git a/docs/scripts/generate-social-cards.ts b/docs/scripts/generate-social-cards.ts
new file mode 100644
index 0000000..5c350d7
--- /dev/null
+++ b/docs/scripts/generate-social-cards.ts
@@ -0,0 +1,16 @@
+import { generateSocialCards } from '@humanspeak/docs-kit/scripts/generate-social-cards'
+import path from 'path'
+import { fileURLToPath } from 'url'
+import { docsConfig } from '../src/lib/docs-config'
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
+const ROOT = path.resolve(__dirname, '..')
+
+await generateSocialCards({
+ npmPackage: docsConfig.npmPackage,
+ defaultTitle: docsConfig.name,
+ defaultDescription: docsConfig.description,
+ defaultFeatures: docsConfig.defaultFeatures,
+ rootDir: ROOT,
+ fontsDir: path.join(ROOT, 'node_modules/@humanspeak/docs-kit/dist/fonts')
+})
diff --git a/docs/src/app.css b/docs/src/app.css
index 5a6c0ee..3108ce4 100644
--- a/docs/src/app.css
+++ b/docs/src/app.css
@@ -1,301 +1,9 @@
@import 'tailwindcss';
+@source '../node_modules/@humanspeak/docs-kit/dist';
+@import '@humanspeak/docs-kit/styles/base.css';
@plugin '@tailwindcss/typography';
-:root {
- /* Brand colors - Humanspeak teal green */
- --color-brand-50: #f0fdfb;
- --color-brand-100: #ccf7ed;
- --color-brand-200: #99eedb;
- --color-brand-300: #66e5c9;
- --color-brand-400: #54dbbc;
- --color-brand-500: #3dbba0;
- --color-brand-600: #2d9984;
- --color-brand-700: #247768;
- --color-brand-800: #1b5a4e;
- --color-brand-900: #134038;
-
- /* Light mode colors */
- --color-background: #ffffff;
- --color-foreground: #0f172a;
- --color-muted: #f8fafc;
- --color-muted-foreground: #64748b;
-
- /* Card colors */
- --color-card: #ffffff;
- --color-card-foreground: #0f172a;
-
- /* Border colors */
- --color-border: #e2e8f0;
- --color-border-muted: #f1f5f9;
- --color-border-mid: #e2e8f0;
-
- /* Primary colors (using brand) */
- --color-primary: var(--color-brand-500);
- --color-primary-foreground: #ffffff;
-
- /* Secondary colors */
- --color-secondary: #f1f5f9;
- --color-secondary-foreground: #0f172a;
-
- /* Accent colors (blue for links/active states) */
- --color-accent: #3b82f6;
- --color-accent-foreground: #ffffff;
- --color-accent-muted: #dbeafe;
-
- /* Text colors for different states */
- --color-text-primary: #0f172a;
- --color-text-secondary: #475569;
- --color-text-muted: #64748b;
- --color-text-inverse: #ffffff;
-
- /* Sidebar specific colors */
- --color-sidebar-background: #ffffff;
- --color-sidebar-foreground: #0f172a;
- --color-sidebar-border: #e2e8f0;
- --color-sidebar-active: #dbeafe;
- --color-sidebar-active-foreground: #1d4ed8;
-
- /* Code colors (light mode: lighter bg, dark text) */
- --color-code-background: #f8f9f9; /* inline code bg */
- --color-code-foreground: #111827; /* near-black text */
- --color-code-block-background: #f5f6f8; /* very light grey block bg */
- --color-code-block-foreground: #111827; /* black/muted text */
-}
-
-.dark {
- /* Dark mode colors */
- --color-background: #0b1011;
- --color-foreground: #f8fafc;
- --color-muted: #1e293b;
- --color-muted-foreground: #a3b2c4; /* slightly brighter for contrast */
-
- /* Card colors */
- --color-card: #1e293b;
- --color-card-foreground: #f8fafc;
-
- /* Border colors */
- --color-border: #334155;
- --color-border-muted: rgba(255, 255, 255, 0.1);
- --color-border-mid: rgba(255, 255, 255, 0.15);
-
- /* Primary colors (using brand) */
- --color-primary: var(--color-brand-500);
- --color-primary-foreground: #ffffff;
-
- /* Secondary colors */
- --color-secondary: #1e293b;
- --color-secondary-foreground: #f8fafc;
-
- /* Accent colors */
- --color-accent: #3b82f6;
- --color-accent-foreground: #ffffff;
- --color-accent-muted: #1e3a8a;
-
- /* Text colors for different states */
- --color-text-primary: #f8fafc;
- --color-text-secondary: #e2e8f0; /* brighter secondary for readability */
- --color-text-muted: #cbd5e1; /* raise contrast of muted */
- --color-text-inverse: #0f172a;
-
- /* Sidebar specific colors */
- --color-sidebar-background: #0b1011;
- --color-sidebar-foreground: #f8fafc;
- --color-sidebar-border: #334155;
- --color-sidebar-active: rgba(59, 130, 246, 0.1);
- --color-sidebar-active-foreground: #60a5fa;
-
- /* Code block colors */
- --color-code-background: #1e293b;
- --color-code-foreground: #f8fafc;
- --color-code-block-background: #0f172a;
- --color-code-block-foreground: #f1f5f9;
-}
-
-@theme {
- /* Map CSS variables to Tailwind colors */
- --color-background: var(--color-background);
- --color-foreground: var(--color-foreground);
- --color-muted: var(--color-muted);
- --color-muted-foreground: var(--color-muted-foreground);
-
- --color-card: var(--color-card);
- --color-card-foreground: var(--color-card-foreground);
-
- --color-border: var(--color-border);
- --color-border-muted: var(--color-border-muted);
- --color-border-mid: var(--color-border-mid);
-
- --color-primary: var(--color-primary);
- --color-primary-foreground: var(--color-primary-foreground);
-
- --color-secondary: var(--color-secondary);
- --color-secondary-foreground: var(--color-secondary-foreground);
-
- --color-accent: var(--color-accent);
- --color-accent-foreground: var(--color-accent-foreground);
- --color-accent-muted: var(--color-accent-muted);
-
- /* Text colors */
- --color-text-primary: var(--color-text-primary);
- --color-text-secondary: var(--color-text-secondary);
- --color-text-muted: var(--color-text-muted);
- --color-text-inverse: var(--color-text-inverse);
-
- /* Sidebar colors */
- --color-sidebar-background: var(--color-sidebar-background);
- --color-sidebar-foreground: var(--color-sidebar-foreground);
- --color-sidebar-border: var(--color-sidebar-border);
- --color-sidebar-active: var(--color-sidebar-active);
- --color-sidebar-active-foreground: var(--color-sidebar-active-foreground);
-
- /* Code colors */
- --color-code-background: var(--color-code-background);
- --color-code-foreground: var(--color-code-foreground);
- --color-code-block-background: var(--color-code-block-background);
- --color-code-block-foreground: var(--color-code-block-foreground);
-
- /* Brand colors */
- --color-brand-50: var(--color-brand-50);
- --color-brand-100: var(--color-brand-100);
- --color-brand-200: var(--color-brand-200);
- --color-brand-300: var(--color-brand-300);
- --color-brand-400: var(--color-brand-400);
- --color-brand-500: var(--color-brand-500);
- --color-brand-600: var(--color-brand-600);
- --color-brand-700: var(--color-brand-700);
- --color-brand-800: var(--color-brand-800);
- --color-brand-900: var(--color-brand-900);
-}
-
-/* Global base styles */
-@layer base {
- * {
- @apply border-border;
- }
-
- html {
- @apply scroll-smooth;
- }
-
- body {
- @apply bg-background text-foreground;
- font-feature-settings:
- 'rlig' 1,
- 'calt' 1;
- }
-
- /* Prose styles for markdown content */
- .prose {
- @apply text-text-primary;
- }
-
- /* Ensure headings override typography plugin defaults in light mode */
- .prose :where(h1, h2, h3, h4, h5, h6) {
- @apply !text-text-primary font-bold;
- }
-
- /* Ensure heading links inherit heading color/contrast */
- .prose h1 a,
- .prose h2 a,
- .prose h3 a,
- .prose h4 a,
- .prose h5 a,
- .prose h6 a {
- @apply text-text-primary hover:text-text-primary no-underline;
- }
-
- .prose p {
- @apply text-text-secondary;
- }
-
- /* Strong emphasis readability in dark mode */
- .prose strong,
- .prose b {
- @apply text-text-primary! font-bold;
- }
-
- /* ensure link color inside paragraphs and lists has adequate contrast */
- .prose p a,
- .prose li a {
- @apply text-accent! hover:text-accent/80! underline-offset-2;
- }
-
- .prose code {
- @apply bg-code-background! text-code-foreground! rounded px-1.5 py-0.5 font-mono text-sm;
- }
-
- .prose pre {
- @apply border-border bg-code-background! text-code-block-foreground! rounded-lg border;
- }
-
- .prose pre code {
- @apply text-code-block-foreground bg-transparent p-0;
- }
-
- /* Shiki syntax highlighting support */
- .prose .shiki-container {
- @apply border-border overflow-hidden rounded-lg border;
- }
-
- .prose .shiki-container pre {
- @apply m-0 rounded-none border-0;
- }
-
- .prose .shiki-container pre.shiki {
- @apply bg-transparent! p-4 text-inherit!;
- }
-
- .prose .shiki-container pre.shiki code {
- @apply bg-transparent! p-0 text-inherit!;
- }
-
- /* Theme switching for Shiki */
- html:not(.dark) .prose .shiki-dark {
- display: none;
- }
-
- html.dark .prose .shiki-light {
- display: none;
- }
-
- /* Ensure proper display */
- .prose .shiki-light,
- .prose .shiki-dark {
- width: 100%;
- }
-
- .prose a {
- @apply text-accent hover:text-accent/80 no-underline;
- }
-
- /* Maintain paragraph/list contrast in dark mode */
- .dark .prose p,
- .dark .prose li {
- @apply text-text-secondary;
- }
-
- .prose blockquote {
- @apply border-border text-text-muted border-l-4 pl-4 italic;
- }
-
- /* Improve list readability and marker contrast (light/dark) */
- .prose ul,
- .prose ol {
- @apply text-text-secondary;
- }
-
- .prose ul > li::marker,
- .prose ol > li::marker {
- color: var(--color-accent);
- }
-
- .prose code::before,
- .prose code::after {
- content: '' !important;
- }
-}
-
-/* Orb backgrounds using the brand color */
+/* Project-specific: landing page decorative styles */
.orb-a-bg {
background: radial-gradient(
circle at 30% 30%,
diff --git a/docs/src/app.html b/docs/src/app.html
index ea1f4b7..637d0ff 100644
--- a/docs/src/app.html
+++ b/docs/src/app.html
@@ -5,9 +5,7 @@
-
-
+
+
diff --git a/docs/src/lib/components/contexts/Breadcrumb/Breadcrumb.context.ts b/docs/src/lib/components/contexts/Breadcrumb/Breadcrumb.context.ts
deleted file mode 100644
index 15bf3e6..0000000
--- a/docs/src/lib/components/contexts/Breadcrumb/Breadcrumb.context.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { BreadcrumbContext } from '$lib/components/contexts/Breadcrumb/type'
-import { getContext, setContext } from 'svelte'
-
-export const BreadcrumbContextSymbol = Symbol('breadcrumbs')
-
-export const getBreadcrumbContext = (): BreadcrumbContext | undefined => {
- return getContext(BreadcrumbContextSymbol)
-}
-
-export const setBreadcrumbContext = (context: BreadcrumbContext): void => {
- setContext(BreadcrumbContextSymbol, context)
-}
diff --git a/docs/src/lib/components/contexts/Breadcrumb/BreadcrumbContext.svelte b/docs/src/lib/components/contexts/Breadcrumb/BreadcrumbContext.svelte
deleted file mode 100644
index c60a23b..0000000
--- a/docs/src/lib/components/contexts/Breadcrumb/BreadcrumbContext.svelte
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-{@render children?.()}
-
-
-
diff --git a/docs/src/lib/components/contexts/Breadcrumb/type.ts b/docs/src/lib/components/contexts/Breadcrumb/type.ts
deleted file mode 100644
index b5af585..0000000
--- a/docs/src/lib/components/contexts/Breadcrumb/type.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// Breadcrumb type
-export type BreadcrumbContext = { breadcrumbs: Breadcrumb[] }
-export type Breadcrumb = { title: string; href?: string }
diff --git a/docs/src/lib/components/contexts/Seo/Seo.context.ts b/docs/src/lib/components/contexts/Seo/Seo.context.ts
deleted file mode 100644
index bc229e7..0000000
--- a/docs/src/lib/components/contexts/Seo/Seo.context.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { SeoContext } from '$lib/components/contexts/Seo/type'
-import { getContext, setContext } from 'svelte'
-
-export const SeoContextSymbol = Symbol('seo')
-
-export const getSeoContext = (): SeoContext | undefined => {
- return getContext(SeoContextSymbol)
-}
-
-export const setSeoContext = (context: SeoContext): void => {
- setContext(SeoContextSymbol, context)
-}
diff --git a/docs/src/lib/components/contexts/Seo/SeoContext.svelte b/docs/src/lib/components/contexts/Seo/SeoContext.svelte
deleted file mode 100644
index 20853b8..0000000
--- a/docs/src/lib/components/contexts/Seo/SeoContext.svelte
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-{@render children?.()}
diff --git a/docs/src/lib/components/contexts/Seo/type.ts b/docs/src/lib/components/contexts/Seo/type.ts
deleted file mode 100644
index d948b53..0000000
--- a/docs/src/lib/components/contexts/Seo/type.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// SEO type
-export type SeoContext = {
- title: string
- description: string
-}
diff --git a/docs/src/lib/components/general/Example.svelte b/docs/src/lib/components/general/Example.svelte
index 14cf0a6..b90a80a 100644
--- a/docs/src/lib/components/general/Example.svelte
+++ b/docs/src/lib/components/general/Example.svelte
@@ -1,4 +1,7 @@
-
-
-
-
+
diff --git a/docs/src/lib/components/general/Header.svelte b/docs/src/lib/components/general/Header.svelte
index 56965c7..f2c4304 100644
--- a/docs/src/lib/components/general/Header.svelte
+++ b/docs/src/lib/components/general/Header.svelte
@@ -1,134 +1,6 @@
-
-
-
-
-
-
- {#if breadcrumbContext && breadcrumbs.length > 0}
-
- {/if}
-
-
-
- {#if mode.current === 'dark'}
-
- {:else}
-
- {/if}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/docs/src/lib/docs-config.ts b/docs/src/lib/docs-config.ts
new file mode 100644
index 0000000..d023700
--- /dev/null
+++ b/docs/src/lib/docs-config.ts
@@ -0,0 +1,27 @@
+import type { DocsKitConfig } from '@humanspeak/docs-kit'
+
+export const docsConfig: DocsKitConfig = {
+ name: 'Memory Cache',
+ slug: 'memory',
+ npmPackage: '@humanspeak/memory-cache',
+ repo: 'humanspeak/memory-cache',
+ url: 'https://memory.svelte.page',
+ description:
+ 'A lightweight, zero-dependency in-memory cache for TypeScript with TTL expiration, LRU eviction, and @cached decorator for method-level memoization.',
+ keywords: [
+ 'cache',
+ 'memory-cache',
+ 'lru-cache',
+ 'ttl-cache',
+ 'typescript',
+ 'memoization',
+ 'decorator',
+ 'in-memory',
+ 'caching',
+ 'performance',
+ 'node.js',
+ 'javascript'
+ ],
+ defaultFeatures: ['Zero Dependencies', 'TypeScript First', 'TTL + LRU', 'Decorator Support'],
+ fallbackStars: 10
+}
diff --git a/docs/src/lib/docsNav.ts b/docs/src/lib/docsNav.ts
new file mode 100644
index 0000000..b3b76f3
--- /dev/null
+++ b/docs/src/lib/docsNav.ts
@@ -0,0 +1,64 @@
+import type { NavSection } from '@humanspeak/docs-kit'
+import AtSign from '@lucide/svelte/icons/at-sign'
+import BarChart3 from '@lucide/svelte/icons/bar-chart-3'
+import Box from '@lucide/svelte/icons/box'
+import Building from '@lucide/svelte/icons/building'
+import Calculator from '@lucide/svelte/icons/calculator'
+import Clock from '@lucide/svelte/icons/clock'
+import Cloud from '@lucide/svelte/icons/cloud'
+import Code from '@lucide/svelte/icons/code'
+import Database from '@lucide/svelte/icons/database'
+import Gauge from '@lucide/svelte/icons/gauge'
+import Layers from '@lucide/svelte/icons/layers'
+import Package from '@lucide/svelte/icons/package'
+import Play from '@lucide/svelte/icons/play'
+import RefreshCw from '@lucide/svelte/icons/refresh-cw'
+import Rocket from '@lucide/svelte/icons/rocket'
+import Sliders from '@lucide/svelte/icons/sliders'
+import Timer from '@lucide/svelte/icons/timer'
+
+export const docsSections: NavSection[] = [
+ {
+ title: 'Get Started',
+ items: [
+ {
+ title: 'Getting Started',
+ href: '/docs/getting-started',
+ icon: Rocket
+ }
+ ]
+ },
+ {
+ title: 'Interactive Demos',
+ items: [
+ { title: 'All Examples', href: '/examples', icon: Play, exact: true },
+ { title: 'Basic Cache', href: '/examples/basic-cache', icon: Box },
+ { title: 'TTL Expiration', href: '/examples/ttl-expiration', icon: Clock },
+ { title: 'LRU Eviction', href: '/examples/lru-eviction', icon: Layers },
+ { title: 'Cache Statistics', href: '/examples/cache-statistics', icon: BarChart3 }
+ ]
+ },
+ {
+ title: 'API Reference',
+ items: [
+ { title: 'MemoryCache', href: '/docs/api/memory-cache', icon: Database },
+ { title: '@cached Decorator', href: '/docs/api/cached-decorator', icon: AtSign }
+ ]
+ },
+ {
+ title: 'Examples',
+ items: [
+ { title: 'Overview', href: '/docs/examples', icon: Code, exact: true },
+ { title: 'Configuration', href: '/docs/examples/configuration', icon: Sliders },
+ { title: 'API Caching', href: '/docs/examples/api-caching', icon: Cloud },
+ { title: 'Async Fetching', href: '/docs/examples/async-fetching', icon: RefreshCw },
+ { title: 'Computed Values', href: '/docs/examples/computed-values', icon: Calculator },
+ { title: 'Database Caching', href: '/docs/examples/database-caching', icon: Database },
+ { title: 'Monitoring', href: '/docs/examples/monitoring', icon: BarChart3 },
+ { title: 'Multi-Tenant', href: '/docs/examples/multi-tenant', icon: Building },
+ { title: 'Rate Limiting', href: '/docs/examples/rate-limiting', icon: Gauge },
+ { title: 'Service Class', href: '/docs/examples/service-class', icon: Package },
+ { title: 'Sessions', href: '/docs/examples/sessions', icon: Timer }
+ ]
+ }
+]
diff --git a/docs/src/lib/examples/BasicCache.svelte b/docs/src/lib/examples/BasicCache.svelte
index 61f19d6..360f680 100644
--- a/docs/src/lib/examples/BasicCache.svelte
+++ b/docs/src/lib/examples/BasicCache.svelte
@@ -1,5 +1,6 @@
-
-
- {seo.title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ const npmUrl = `https://www.npmjs.com/package/${docsConfig.npmPackage}`
+ const repoUrl = `https://github.com/${docsConfig.repo}`
-
-
-
-
-
-
-
+ aggregateRating: {
+ '@type': 'AggregateRating',
+ ratingValue: '5',
+ ratingCount: String(githubStats.stars),
+ bestRating: '5'
+ }
+ }) +
+ '<' +
+ '/script>'
+
+
+
+
+
+ {@html softwareAppJsonLd}
-
-
+
+
+
+
{@render children?.()}
-
-
+
+
diff --git a/docs/src/routes/+page.svelte b/docs/src/routes/+page.svelte
index 49ed9d3..9b1310d 100644
--- a/docs/src/routes/+page.svelte
+++ b/docs/src/routes/+page.svelte
@@ -1,18 +1,25 @@
-
-
+
-
{#each features as feature}
+ {@const FeatureIcon = feature.icon}
@@ -376,7 +380,6 @@ cache.set(
'user:123', {'{'} name:
{
- try {
- const controller = new AbortController()
- const timeoutId = setTimeout(() => controller.abort(), 5000)
-
- const response = await fetch('https://svelte.page/api/v1/others', {
- signal: controller.signal
- })
- clearTimeout(timeoutId)
-
- if (!response.ok) {
- throw new Error(`HTTP ${response.status}`)
- }
-
- const projects = (await response.json()) as OtherProject[]
-
- // Validate response structure
- if (!Array.isArray(projects)) {
- throw new Error('Invalid response: expected array')
- }
-
- // Filter out this project (memory-cache)
- const otherProjects = projects.filter((project) => project.slug !== 'memory')
-
- return json(otherProjects)
- } catch (error) {
- console.error('Failed to fetch other projects:', error)
- // Return empty array on error
- return json([])
- }
-}
diff --git a/docs/src/routes/docs/+layout.server.ts b/docs/src/routes/docs/+layout.server.ts
new file mode 100644
index 0000000..19e9a34
--- /dev/null
+++ b/docs/src/routes/docs/+layout.server.ts
@@ -0,0 +1,6 @@
+import { fetchOtherProjects } from '@humanspeak/docs-kit'
+import type { LayoutServerLoad } from './$types'
+
+export const load: LayoutServerLoad = async () => {
+ return { otherProjects: await fetchOtherProjects('memory') }
+}
diff --git a/docs/src/routes/docs/+layout.svelte b/docs/src/routes/docs/+layout.svelte
index a8b32ff..07eab94 100644
--- a/docs/src/routes/docs/+layout.svelte
+++ b/docs/src/routes/docs/+layout.svelte
@@ -1,26 +1,29 @@
-
-
diff --git a/docs/src/routes/docs/api/cached-decorator/+page.svx b/docs/src/routes/docs/api/cached-decorator/+page.svx
index 9ed20f6..6e1d87e 100644
--- a/docs/src/routes/docs/api/cached-decorator/+page.svx
+++ b/docs/src/routes/docs/api/cached-decorator/+page.svx
@@ -3,6 +3,19 @@ title: "@cached Decorator"
description: API reference for the @cached method decorator
---
+
+
# @cached Decorator
The `@cached` decorator provides automatic method-level caching (memoization). It caches method results based on their arguments, so repeated calls with the same arguments return the cached result instantly.
diff --git a/docs/src/routes/docs/api/memory-cache/+page.svx b/docs/src/routes/docs/api/memory-cache/+page.svx
index c37927a..fee8242 100644
--- a/docs/src/routes/docs/api/memory-cache/+page.svx
+++ b/docs/src/routes/docs/api/memory-cache/+page.svx
@@ -3,6 +3,19 @@ title: MemoryCache API
description: Complete API reference for the MemoryCache class
---
+
+
# MemoryCache API
The `MemoryCache` class is a generic in-memory cache with TTL expiration and LRU (Least Recently Used) eviction.
diff --git a/docs/src/routes/docs/examples/+page.svelte b/docs/src/routes/docs/examples/+page.svelte
index 5be0f0e..750b3f3 100644
--- a/docs/src/routes/docs/examples/+page.svelte
+++ b/docs/src/routes/docs/examples/+page.svelte
@@ -1,23 +1,37 @@
+
# API Response Caching
Cache API responses to reduce network requests and improve response times.
diff --git a/docs/src/routes/docs/examples/async-fetching/+page.svx b/docs/src/routes/docs/examples/async-fetching/+page.svx
index 7543dd7..b63400b 100644
--- a/docs/src/routes/docs/examples/async-fetching/+page.svx
+++ b/docs/src/routes/docs/examples/async-fetching/+page.svx
@@ -3,6 +3,19 @@ title: Async Fetching
description: Cache expensive async operations with getOrSet
---
+
+
# Async Fetching
Use `getOrSet` to automatically cache the results of expensive async operations.
diff --git a/docs/src/routes/docs/examples/computed-values/+page.svx b/docs/src/routes/docs/examples/computed-values/+page.svx
index 8f41995..f11e5a8 100644
--- a/docs/src/routes/docs/examples/computed-values/+page.svx
+++ b/docs/src/routes/docs/examples/computed-values/+page.svx
@@ -3,6 +3,19 @@ title: Computed Value Caching
description: Cache expensive computations
---
+
+
# Computed Value Caching
Cache expensive computations where results are deterministic.
diff --git a/docs/src/routes/docs/examples/configuration/+page.svx b/docs/src/routes/docs/examples/configuration/+page.svx
index 46cae9e..df85f8a 100644
--- a/docs/src/routes/docs/examples/configuration/+page.svx
+++ b/docs/src/routes/docs/examples/configuration/+page.svx
@@ -3,6 +3,19 @@ title: Configuration Cache
description: Cache configuration that rarely changes
---
+
+
# Configuration Cache
Cache configuration that rarely changes to avoid repeated fetches.
diff --git a/docs/src/routes/docs/examples/database-caching/+page.svx b/docs/src/routes/docs/examples/database-caching/+page.svx
index 257a74e..4a5ef3d 100644
--- a/docs/src/routes/docs/examples/database-caching/+page.svx
+++ b/docs/src/routes/docs/examples/database-caching/+page.svx
@@ -3,6 +3,19 @@ title: Database Query Caching
description: Cache expensive database queries with the @cached decorator
---
+
+
# Database Query Caching
Cache expensive database queries using the `@cached` decorator.
diff --git a/docs/src/routes/docs/examples/monitoring/+page.svx b/docs/src/routes/docs/examples/monitoring/+page.svx
index 43d17e5..ebb1c45 100644
--- a/docs/src/routes/docs/examples/monitoring/+page.svx
+++ b/docs/src/routes/docs/examples/monitoring/+page.svx
@@ -3,6 +3,19 @@ title: Monitoring with Hooks
description: Integrate with metrics and logging systems
---
+
+
# Monitoring with Hooks
Use cache hooks to integrate with metrics, logging, and monitoring systems.
diff --git a/docs/src/routes/docs/examples/multi-tenant/+page.svx b/docs/src/routes/docs/examples/multi-tenant/+page.svx
index 5bfcd19..10713b5 100644
--- a/docs/src/routes/docs/examples/multi-tenant/+page.svx
+++ b/docs/src/routes/docs/examples/multi-tenant/+page.svx
@@ -3,6 +3,19 @@ title: Multi-Tenant Cache Invalidation
description: Use prefix and wildcard deletion for multi-tenant applications
---
+
+
# Multi-Tenant Cache Invalidation
Use prefix and wildcard deletion for efficient cache invalidation in multi-tenant applications.
diff --git a/docs/src/routes/docs/examples/rate-limiting/+page.svx b/docs/src/routes/docs/examples/rate-limiting/+page.svx
index 0d03ba2..d0fbdb6 100644
--- a/docs/src/routes/docs/examples/rate-limiting/+page.svx
+++ b/docs/src/routes/docs/examples/rate-limiting/+page.svx
@@ -3,6 +3,19 @@ title: Rate Limiting
description: Simple rate limiting using cache
---
+
+
# Rate Limiting
Implement simple rate limiting using cache TTL.
diff --git a/docs/src/routes/docs/examples/service-class/+page.svx b/docs/src/routes/docs/examples/service-class/+page.svx
index f938598..d9df5b0 100644
--- a/docs/src/routes/docs/examples/service-class/+page.svx
+++ b/docs/src/routes/docs/examples/service-class/+page.svx
@@ -3,6 +3,19 @@ title: Service Class Pattern
description: Full service class example using the decorator
---
+
+
# Service Class Pattern
A complete example of using the `@cached` decorator with a service class.
diff --git a/docs/src/routes/docs/examples/sessions/+page.svx b/docs/src/routes/docs/examples/sessions/+page.svx
index 7e6498a..8b70169 100644
--- a/docs/src/routes/docs/examples/sessions/+page.svx
+++ b/docs/src/routes/docs/examples/sessions/+page.svx
@@ -3,6 +3,19 @@ title: Session Storage
description: Store user sessions with automatic expiration
---
+
+
# Session Storage
Store user sessions with automatic expiration using TTL.
diff --git a/docs/src/routes/docs/getting-started/+page.svx b/docs/src/routes/docs/getting-started/+page.svx
index 24981e4..3cac20f 100644
--- a/docs/src/routes/docs/getting-started/+page.svx
+++ b/docs/src/routes/docs/getting-started/+page.svx
@@ -3,6 +3,19 @@ title: Getting Started
description: Get started with @humanspeak/memory-cache
---
+
+
# Getting Started
@humanspeak/memory-cache is a lightweight, zero-dependency in-memory cache for TypeScript and JavaScript. It provides TTL expiration, true LRU (Least Recently Used) eviction, wildcard pattern deletion, and a powerful `@cached` decorator for method-level memoization.
diff --git a/docs/src/routes/examples/+page.svelte b/docs/src/routes/examples/+page.svelte
index 5c14100..7dcf022 100644
--- a/docs/src/routes/examples/+page.svelte
+++ b/docs/src/routes/examples/+page.svelte
@@ -1,43 +1,47 @@
@@ -56,6 +60,7 @@
@@ -102,7 +107,7 @@
class="inline-flex items-center rounded-lg bg-gradient-to-r from-brand-500 to-brand-600 px-5 py-2.5 font-medium text-white transition-all duration-200 hover:from-brand-600 hover:to-brand-700"
>
Get Started
-
+
diff --git a/docs/src/routes/examples/basic-cache/+page.svelte b/docs/src/routes/examples/basic-cache/+page.svelte
index 6340cb8..8f2b20a 100644
--- a/docs/src/routes/examples/basic-cache/+page.svelte
+++ b/docs/src/routes/examples/basic-cache/+page.svelte
@@ -1,23 +1,20 @@
diff --git a/docs/src/routes/examples/cache-statistics/+page.svelte b/docs/src/routes/examples/cache-statistics/+page.svelte
index ef1321e..a4380ca 100644
--- a/docs/src/routes/examples/cache-statistics/+page.svelte
+++ b/docs/src/routes/examples/cache-statistics/+page.svelte
@@ -1,23 +1,20 @@
diff --git a/docs/src/routes/examples/lru-eviction/+page.svelte b/docs/src/routes/examples/lru-eviction/+page.svelte
index 7b5c98a..c5da541 100644
--- a/docs/src/routes/examples/lru-eviction/+page.svelte
+++ b/docs/src/routes/examples/lru-eviction/+page.svelte
@@ -1,23 +1,20 @@
diff --git a/docs/src/routes/examples/ttl-expiration/+page.svelte b/docs/src/routes/examples/ttl-expiration/+page.svelte
index 2ebd731..60ac6a4 100644
--- a/docs/src/routes/examples/ttl-expiration/+page.svelte
+++ b/docs/src/routes/examples/ttl-expiration/+page.svelte
@@ -1,23 +1,20 @@
diff --git a/docs/static/humanspeak-dark.svg b/docs/static/humanspeak-dark.svg
new file mode 100644
index 0000000..5479c3c
--- /dev/null
+++ b/docs/static/humanspeak-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/static/humanspeak.svg b/docs/static/humanspeak.svg
new file mode 100644
index 0000000..1258a14
--- /dev/null
+++ b/docs/static/humanspeak.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/static/svelte-logo.svg b/docs/static/svelte-logo.svg
new file mode 100644
index 0000000..d3f0808
--- /dev/null
+++ b/docs/static/svelte-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/svelte.config.js b/docs/svelte.config.js
index ff12e9c..7abdcfa 100644
--- a/docs/svelte.config.js
+++ b/docs/svelte.config.js
@@ -40,7 +40,21 @@ const config = {
],
kit: {
- adapter: adapter()
+ adapter: adapter(),
+ csp: {
+ directives: {
+ 'default-src': ['self'],
+ 'script-src': ['self', 'https://analytics.ahrefs.com'],
+ 'style-src': ['self', 'unsafe-inline'],
+ 'img-src': ['self', 'data:'],
+ 'font-src': ['self'],
+ 'connect-src': ['self', 'https://analytics.ahrefs.com'],
+ 'object-src': ['none'],
+ 'base-uri': ['self'],
+ 'form-action': ['self'],
+ 'frame-ancestors': ['none']
+ }
+ }
},
extensions: ['.svelte', '.svx']
diff --git a/docs/vite.config.ts b/docs/vite.config.ts
index ec4312e..581cd1f 100644
--- a/docs/vite.config.ts
+++ b/docs/vite.config.ts
@@ -5,6 +5,6 @@ import { defineConfig } from 'vite'
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
server: {
- port: 8234
+ port: 8288
}
})
diff --git a/docs/worker-configuration.d.ts b/docs/worker-configuration.d.ts
new file mode 100644
index 0000000..a79b1f7
--- /dev/null
+++ b/docs/worker-configuration.d.ts
@@ -0,0 +1,11307 @@
+/* eslint-disable */
+// Generated by Wrangler by running `wrangler types` (hash: 87b8d0306068c711c38382b472371f1d)
+// Runtime types generated with workerd@1.20260301.1 2026-01-20 nodejs_als,nodejs_compat
+declare namespace Cloudflare {
+ interface Env {
+ PUBLIC_ENVIRONMENT: "production";
+ ENVIRONMENT: "production";
+ NODE_ENV: "production";
+ }
+}
+interface Env extends Cloudflare.Env {}
+type StringifyValues> = {
+ [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
+};
+declare namespace NodeJS {
+ interface ProcessEnv extends StringifyValues> {}
+}
+
+// Begin runtime types
+/*! *****************************************************************************
+Copyright (c) Cloudflare. All rights reserved.
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+/* eslint-disable */
+// noinspection JSUnusedGlobalSymbols
+declare var onmessage: never;
+/**
+ * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
+ */
+declare class DOMException extends Error {
+ constructor(message?: string, name?: string);
+ /**
+ * The **`message`** read-only property of the a message or description associated with the given error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
+ */
+ readonly message: string;
+ /**
+ * The **`name`** read-only property of the one of the strings associated with an error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
+ */
+ readonly name: string;
+ /**
+ * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
+ */
+ readonly code: number;
+ static readonly INDEX_SIZE_ERR: number;
+ static readonly DOMSTRING_SIZE_ERR: number;
+ static readonly HIERARCHY_REQUEST_ERR: number;
+ static readonly WRONG_DOCUMENT_ERR: number;
+ static readonly INVALID_CHARACTER_ERR: number;
+ static readonly NO_DATA_ALLOWED_ERR: number;
+ static readonly NO_MODIFICATION_ALLOWED_ERR: number;
+ static readonly NOT_FOUND_ERR: number;
+ static readonly NOT_SUPPORTED_ERR: number;
+ static readonly INUSE_ATTRIBUTE_ERR: number;
+ static readonly INVALID_STATE_ERR: number;
+ static readonly SYNTAX_ERR: number;
+ static readonly INVALID_MODIFICATION_ERR: number;
+ static readonly NAMESPACE_ERR: number;
+ static readonly INVALID_ACCESS_ERR: number;
+ static readonly VALIDATION_ERR: number;
+ static readonly TYPE_MISMATCH_ERR: number;
+ static readonly SECURITY_ERR: number;
+ static readonly NETWORK_ERR: number;
+ static readonly ABORT_ERR: number;
+ static readonly URL_MISMATCH_ERR: number;
+ static readonly QUOTA_EXCEEDED_ERR: number;
+ static readonly TIMEOUT_ERR: number;
+ static readonly INVALID_NODE_TYPE_ERR: number;
+ static readonly DATA_CLONE_ERR: number;
+ get stack(): any;
+ set stack(value: any);
+}
+type WorkerGlobalScopeEventMap = {
+ fetch: FetchEvent;
+ scheduled: ScheduledEvent;
+ queue: QueueEvent;
+ unhandledrejection: PromiseRejectionEvent;
+ rejectionhandled: PromiseRejectionEvent;
+};
+declare abstract class WorkerGlobalScope extends EventTarget {
+ EventTarget: typeof EventTarget;
+}
+/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
+ * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console)
+ */
+interface Console {
+ "assert"(condition?: boolean, ...data: any[]): void;
+ /**
+ * The **`console.clear()`** static method clears the console if possible.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
+ */
+ clear(): void;
+ /**
+ * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
+ */
+ count(label?: string): void;
+ /**
+ * The **`console.countReset()`** static method resets counter used with console/count_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
+ */
+ countReset(label?: string): void;
+ /**
+ * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
+ */
+ debug(...data: any[]): void;
+ /**
+ * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
+ */
+ dir(item?: any, options?: any): void;
+ /**
+ * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
+ */
+ dirxml(...data: any[]): void;
+ /**
+ * The **`console.error()`** static method outputs a message to the console at the 'error' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
+ */
+ error(...data: any[]): void;
+ /**
+ * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
+ */
+ group(...data: any[]): void;
+ /**
+ * The **`console.groupCollapsed()`** static method creates a new inline group in the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
+ */
+ groupCollapsed(...data: any[]): void;
+ /**
+ * The **`console.groupEnd()`** static method exits the current inline group in the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
+ */
+ groupEnd(): void;
+ /**
+ * The **`console.info()`** static method outputs a message to the console at the 'info' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
+ */
+ info(...data: any[]): void;
+ /**
+ * The **`console.log()`** static method outputs a message to the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
+ */
+ log(...data: any[]): void;
+ /**
+ * The **`console.table()`** static method displays tabular data as a table.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
+ */
+ table(tabularData?: any, properties?: string[]): void;
+ /**
+ * The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
+ */
+ time(label?: string): void;
+ /**
+ * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
+ */
+ timeEnd(label?: string): void;
+ /**
+ * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
+ */
+ timeLog(label?: string, ...data: any[]): void;
+ timeStamp(label?: string): void;
+ /**
+ * The **`console.trace()`** static method outputs a stack trace to the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
+ */
+ trace(...data: any[]): void;
+ /**
+ * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
+ */
+ warn(...data: any[]): void;
+}
+declare const console: Console;
+type BufferSource = ArrayBufferView | ArrayBuffer;
+type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
+declare namespace WebAssembly {
+ class CompileError extends Error {
+ constructor(message?: string);
+ }
+ class RuntimeError extends Error {
+ constructor(message?: string);
+ }
+ type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
+ interface GlobalDescriptor {
+ value: ValueType;
+ mutable?: boolean;
+ }
+ class Global {
+ constructor(descriptor: GlobalDescriptor, value?: any);
+ value: any;
+ valueOf(): any;
+ }
+ type ImportValue = ExportValue | number;
+ type ModuleImports = Record;
+ type Imports = Record;
+ type ExportValue = Function | Global | Memory | Table;
+ type Exports = Record;
+ class Instance {
+ constructor(module: Module, imports?: Imports);
+ readonly exports: Exports;
+ }
+ interface MemoryDescriptor {
+ initial: number;
+ maximum?: number;
+ shared?: boolean;
+ }
+ class Memory {
+ constructor(descriptor: MemoryDescriptor);
+ readonly buffer: ArrayBuffer;
+ grow(delta: number): number;
+ }
+ type ImportExportKind = "function" | "global" | "memory" | "table";
+ interface ModuleExportDescriptor {
+ kind: ImportExportKind;
+ name: string;
+ }
+ interface ModuleImportDescriptor {
+ kind: ImportExportKind;
+ module: string;
+ name: string;
+ }
+ abstract class Module {
+ static customSections(module: Module, sectionName: string): ArrayBuffer[];
+ static exports(module: Module): ModuleExportDescriptor[];
+ static imports(module: Module): ModuleImportDescriptor[];
+ }
+ type TableKind = "anyfunc" | "externref";
+ interface TableDescriptor {
+ element: TableKind;
+ initial: number;
+ maximum?: number;
+ }
+ class Table {
+ constructor(descriptor: TableDescriptor, value?: any);
+ readonly length: number;
+ get(index: number): any;
+ grow(delta: number, value?: any): number;
+ set(index: number, value?: any): void;
+ }
+ function instantiate(module: Module, imports?: Imports): Promise;
+ function validate(bytes: BufferSource): boolean;
+}
+/**
+ * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
+ */
+interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
+ DOMException: typeof DOMException;
+ WorkerGlobalScope: typeof WorkerGlobalScope;
+ btoa(data: string): string;
+ atob(data: string): string;
+ setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+ setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearTimeout(timeoutId: number | null): void;
+ setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+ setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearInterval(timeoutId: number | null): void;
+ queueMicrotask(task: Function): void;
+ structuredClone(value: T, options?: StructuredSerializeOptions): T;
+ reportError(error: any): void;
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+ self: ServiceWorkerGlobalScope;
+ crypto: Crypto;
+ caches: CacheStorage;
+ scheduler: Scheduler;
+ performance: Performance;
+ Cloudflare: Cloudflare;
+ readonly origin: string;
+ Event: typeof Event;
+ ExtendableEvent: typeof ExtendableEvent;
+ CustomEvent: typeof CustomEvent;
+ PromiseRejectionEvent: typeof PromiseRejectionEvent;
+ FetchEvent: typeof FetchEvent;
+ TailEvent: typeof TailEvent;
+ TraceEvent: typeof TailEvent;
+ ScheduledEvent: typeof ScheduledEvent;
+ MessageEvent: typeof MessageEvent;
+ CloseEvent: typeof CloseEvent;
+ ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
+ ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
+ ReadableStream: typeof ReadableStream;
+ WritableStream: typeof WritableStream;
+ WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
+ TransformStream: typeof TransformStream;
+ ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
+ CountQueuingStrategy: typeof CountQueuingStrategy;
+ ErrorEvent: typeof ErrorEvent;
+ MessageChannel: typeof MessageChannel;
+ MessagePort: typeof MessagePort;
+ EventSource: typeof EventSource;
+ ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
+ ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
+ ReadableByteStreamController: typeof ReadableByteStreamController;
+ WritableStreamDefaultController: typeof WritableStreamDefaultController;
+ TransformStreamDefaultController: typeof TransformStreamDefaultController;
+ CompressionStream: typeof CompressionStream;
+ DecompressionStream: typeof DecompressionStream;
+ TextEncoderStream: typeof TextEncoderStream;
+ TextDecoderStream: typeof TextDecoderStream;
+ Headers: typeof Headers;
+ Body: typeof Body;
+ Request: typeof Request;
+ Response: typeof Response;
+ WebSocket: typeof WebSocket;
+ WebSocketPair: typeof WebSocketPair;
+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
+ AbortController: typeof AbortController;
+ AbortSignal: typeof AbortSignal;
+ TextDecoder: typeof TextDecoder;
+ TextEncoder: typeof TextEncoder;
+ navigator: Navigator;
+ Navigator: typeof Navigator;
+ URL: typeof URL;
+ URLSearchParams: typeof URLSearchParams;
+ URLPattern: typeof URLPattern;
+ Blob: typeof Blob;
+ File: typeof File;
+ FormData: typeof FormData;
+ Crypto: typeof Crypto;
+ SubtleCrypto: typeof SubtleCrypto;
+ CryptoKey: typeof CryptoKey;
+ CacheStorage: typeof CacheStorage;
+ Cache: typeof Cache;
+ FixedLengthStream: typeof FixedLengthStream;
+ IdentityTransformStream: typeof IdentityTransformStream;
+ HTMLRewriter: typeof HTMLRewriter;
+}
+declare function addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void;
+declare function removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void;
+/**
+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
+ */
+declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
+declare function btoa(data: string): string;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
+declare function atob(data: string): string;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
+declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
+declare function setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
+declare function clearTimeout(timeoutId: number | null): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
+declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
+declare function setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
+declare function clearInterval(timeoutId: number | null): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
+declare function queueMicrotask(task: Function): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
+declare function structuredClone(value: T, options?: StructuredSerializeOptions): T;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
+declare function reportError(error: any): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
+declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+declare const self: ServiceWorkerGlobalScope;
+/**
+* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
+* The Workers runtime implements the full surface of this API, but with some differences in
+* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
+* compared to those implemented in most browsers.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
+*/
+declare const crypto: Crypto;
+/**
+* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+*/
+declare const caches: CacheStorage;
+declare const scheduler: Scheduler;
+/**
+* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
+* as well as timing of subrequests and other operations.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
+*/
+declare const performance: Performance;
+declare const Cloudflare: Cloudflare;
+declare const origin: string;
+declare const navigator: Navigator;
+interface TestController {
+}
+interface ExecutionContext {
+ waitUntil(promise: Promise): void;
+ passThroughOnException(): void;
+ readonly exports: Cloudflare.Exports;
+ readonly props: Props;
+}
+type ExportedHandlerFetchHandler = (request: Request>, env: Env, ctx: ExecutionContext) => Response | Promise;
+type ExportedHandlerTailHandler = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTraceHandler = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise;
+type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerQueueHandler = (batch: MessageBatch, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTestHandler = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise;
+interface ExportedHandler {
+ fetch?: ExportedHandlerFetchHandler;
+ tail?: ExportedHandlerTailHandler;
+ trace?: ExportedHandlerTraceHandler;
+ tailStream?: ExportedHandlerTailStreamHandler;
+ scheduled?: ExportedHandlerScheduledHandler;
+ test?: ExportedHandlerTestHandler;
+ email?: EmailExportedHandler;
+ queue?: ExportedHandlerQueueHandler;
+}
+interface StructuredSerializeOptions {
+ transfer?: any[];
+}
+declare abstract class Navigator {
+ sendBeacon(url: string, body?: BodyInit): boolean;
+ readonly userAgent: string;
+ readonly hardwareConcurrency: number;
+ readonly language: string;
+ readonly languages: string[];
+}
+interface AlarmInvocationInfo {
+ readonly isRetry: boolean;
+ readonly retryCount: number;
+}
+interface Cloudflare {
+ readonly compatibilityFlags: Record;
+}
+interface DurableObject {
+ fetch(request: Request): Response | Promise;
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise;
+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise;
+ webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise;
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise;
+}
+type DurableObjectStub = Fetcher & {
+ readonly id: DurableObjectId;
+ readonly name?: string;
+};
+interface DurableObjectId {
+ toString(): string;
+ equals(other: DurableObjectId): boolean;
+ readonly name?: string;
+}
+declare abstract class DurableObjectNamespace {
+ newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
+ idFromName(name: string): DurableObjectId;
+ idFromString(id: string): DurableObjectId;
+ get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
+ getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
+ jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
+}
+type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
+interface DurableObjectNamespaceNewUniqueIdOptions {
+ jurisdiction?: DurableObjectJurisdiction;
+}
+type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
+type DurableObjectRoutingMode = "primary-only";
+interface DurableObjectNamespaceGetDurableObjectOptions {
+ locationHint?: DurableObjectLocationHint;
+ routingMode?: DurableObjectRoutingMode;
+}
+interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
+}
+interface DurableObjectState {
+ waitUntil(promise: Promise): void;
+ readonly exports: Cloudflare.Exports;
+ readonly props: Props;
+ readonly id: DurableObjectId;
+ readonly storage: DurableObjectStorage;
+ container?: Container;
+ blockConcurrencyWhile(callback: () => Promise): Promise;
+ acceptWebSocket(ws: WebSocket, tags?: string[]): void;
+ getWebSockets(tag?: string): WebSocket[];
+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
+ getHibernatableWebSocketEventTimeout(): number | null;
+ getTags(ws: WebSocket): string[];
+ abort(reason?: string): void;
+}
+interface DurableObjectTransaction {
+ get(key: string, options?: DurableObjectGetOptions): Promise;
+ get(keys: string[], options?: DurableObjectGetOptions): Promise