@deot/docs-client 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { DocsThemeOptions } from '@deot/docs-theme';
5
5
  import { DocsThemePreference } from '@deot/docs-theme';
6
6
  import { HTTPController } from '@deot/http-core';
7
7
  import { Language } from '@deot/docs-locale';
8
- import type { Ref } from 'vue';
8
+ import { Ref } from 'vue';
9
9
  import type { RendererDocument } from '@deot/docs-renderer';
10
10
  import type { RendererModuleSource } from '@deot/docs-renderer';
11
11
  import type { RouteLocationNormalized } from 'vue-router';
@@ -30,12 +30,14 @@ export declare interface DocsConfig {
30
30
  locales: Record<string, DocsLocaleEntry>;
31
31
  routes: Record<string, DocsRouteConfig>;
32
32
  base?: string;
33
+ repository?: string;
33
34
  namespace?: string;
34
35
  modules?: Record<string, string>;
35
36
  styles?: Record<string, string>;
36
37
  prefetch?: boolean | DocsPrefetchOptions;
37
38
  theme?: boolean | DocsThemeOptions;
38
39
  home?: DocsHomeOptions;
40
+ layout?: DocsLayoutOptions;
39
41
  renderers?: RendererModuleSource[];
40
42
  resolve?: {
41
43
  markdown?: (context: DocsMarkdownContext) => string | Promise<string>;
@@ -47,10 +49,21 @@ export declare interface DocsConfig {
47
49
 
48
50
  export declare type DocsContent = DocsSlot | RendererDocument;
49
51
 
52
+ export declare interface DocsFooterOptions {
53
+ groups?: DocsLocalized<SidebarItem[]>;
54
+ poweredBy?: DocsLocalized<DocsFooterPoweredBy>;
55
+ }
56
+
57
+ export declare type DocsFooterPoweredBy = 'default' | string | false;
58
+
50
59
  export declare interface DocsHomeOptions {
51
60
  locales: Record<string, RendererDocument | string>;
52
61
  }
53
62
 
63
+ export declare interface DocsLayoutOptions {
64
+ footer?: 'default' | DocsFooterOptions | false;
65
+ }
66
+
54
67
  export declare interface DocsLinkContext {
55
68
  href: string;
56
69
  lang: string;
@@ -60,6 +73,8 @@ export declare interface DocsLinkContext {
60
73
 
61
74
  export { DocsLocaleEntry }
62
75
 
76
+ export declare type DocsLocalized<T> = T | Record<string, T>;
77
+
63
78
  export declare interface DocsMarkdownContext {
64
79
  lang: string;
65
80
  value: string;
@@ -398,6 +413,11 @@ export declare interface ResourceVersion {
398
413
  updatedAt: number;
399
414
  }
400
415
 
416
+ declare interface SettingsAccess {
417
+ get<T>(namespace: string, key: string): Promise<T | null>;
418
+ set<T>(namespace: string, key: string, value: T): Promise<void>;
419
+ }
420
+
401
421
  export declare interface SidebarItem {
402
422
  label: string;
403
423
  value?: string;
@@ -415,7 +435,47 @@ declare interface TextResponse {
415
435
  lastModified?: string;
416
436
  }
417
437
 
418
- export declare const Theme: DocsThemeController;
438
+ export declare const Theme: ThemeSettingsManager;
439
+
440
+ declare class ThemeSettingsManager implements DocsThemeController {
441
+ private settings;
442
+ private value;
443
+ private enabledValue;
444
+ private readyValue;
445
+ private active;
446
+ private namespace;
447
+ private media?;
448
+ private session;
449
+ private preferenceVersion;
450
+ private followingSystem;
451
+ private target?;
452
+ private appliedTarget?;
453
+ private appliedTheme?;
454
+ private operation?;
455
+ private queued?;
456
+ private requested?;
457
+ readonly current: Readonly<Ref<"light" | "dark", "light" | "dark">>;
458
+ readonly enabled: Readonly<Ref<boolean, boolean>>;
459
+ readonly ready: Readonly<Ref<boolean, boolean>>;
460
+ constructor(settings: SettingsAccess);
461
+ private normalizeDefault;
462
+ private getSystemTheme;
463
+ private resolveInitialTheme;
464
+ private apply;
465
+ private detachSystemListener;
466
+ private attachSystemListener;
467
+ private handleSystemChange;
468
+ private shouldAnimate;
469
+ private resolveTransitionPoint;
470
+ private applyWithTransition;
471
+ private restore;
472
+ start(config: DocsConfig, target?: Window): () => void;
473
+ private stop;
474
+ private flush;
475
+ private ensureFlush;
476
+ set(theme: DocsTheme, origin?: HTMLElement): Promise<void>;
477
+ toggle(origin?: HTMLElement): Promise<void>;
478
+ }
419
479
 
420
480
  export declare const trimSlashes: (value: string) => string;
421
481