@hamak/ui-shell-api 0.1.0

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.
Files changed (68) hide show
  1. package/.turbo/turbo-build.log +1 -0
  2. package/README.md +58 -0
  3. package/dist/api/IFeatureManager.d.ts +56 -0
  4. package/dist/api/IFeatureManager.d.ts.map +1 -0
  5. package/dist/api/IFeatureManager.js +5 -0
  6. package/dist/api/ILayoutManager.d.ts +40 -0
  7. package/dist/api/ILayoutManager.d.ts.map +1 -0
  8. package/dist/api/ILayoutManager.js +5 -0
  9. package/dist/api/IRouter.d.ts +40 -0
  10. package/dist/api/IRouter.d.ts.map +1 -0
  11. package/dist/api/IRouter.js +5 -0
  12. package/dist/api/IShell.d.ts +55 -0
  13. package/dist/api/IShell.d.ts.map +1 -0
  14. package/dist/api/IShell.js +5 -0
  15. package/dist/api/IThemeManager.d.ts +36 -0
  16. package/dist/api/IThemeManager.d.ts.map +1 -0
  17. package/dist/api/IThemeManager.js +5 -0
  18. package/dist/api/index.d.ts +10 -0
  19. package/dist/api/index.d.ts.map +1 -0
  20. package/dist/api/index.js +9 -0
  21. package/dist/index.d.ts +12 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +14 -0
  24. package/dist/tokens/index.d.ts +6 -0
  25. package/dist/tokens/index.d.ts.map +1 -0
  26. package/dist/tokens/index.js +5 -0
  27. package/dist/tokens/service-tokens.d.ts +57 -0
  28. package/dist/tokens/service-tokens.d.ts.map +1 -0
  29. package/dist/tokens/service-tokens.js +56 -0
  30. package/dist/types/event-types.d.ts +14 -0
  31. package/dist/types/event-types.d.ts.map +1 -0
  32. package/dist/types/event-types.js +5 -0
  33. package/dist/types/feature-types.d.ts +26 -0
  34. package/dist/types/feature-types.d.ts.map +1 -0
  35. package/dist/types/feature-types.js +26 -0
  36. package/dist/types/index.d.ts +11 -0
  37. package/dist/types/index.d.ts.map +1 -0
  38. package/dist/types/index.js +10 -0
  39. package/dist/types/layout-types.d.ts +29 -0
  40. package/dist/types/layout-types.d.ts.map +1 -0
  41. package/dist/types/layout-types.js +5 -0
  42. package/dist/types/route-types.d.ts +22 -0
  43. package/dist/types/route-types.d.ts.map +1 -0
  44. package/dist/types/route-types.js +5 -0
  45. package/dist/types/shell-context.d.ts +34 -0
  46. package/dist/types/shell-context.d.ts.map +1 -0
  47. package/dist/types/shell-context.js +5 -0
  48. package/dist/types/theme-types.d.ts +13 -0
  49. package/dist/types/theme-types.d.ts.map +1 -0
  50. package/dist/types/theme-types.js +5 -0
  51. package/package.json +31 -0
  52. package/src/api/IFeatureManager.ts +68 -0
  53. package/src/api/ILayoutManager.ts +48 -0
  54. package/src/api/IRouter.ts +48 -0
  55. package/src/api/IShell.ts +66 -0
  56. package/src/api/IThemeManager.ts +43 -0
  57. package/src/api/index.ts +10 -0
  58. package/src/index.ts +18 -0
  59. package/src/tokens/index.ts +6 -0
  60. package/src/tokens/service-tokens.ts +64 -0
  61. package/src/types/event-types.ts +22 -0
  62. package/src/types/feature-types.ts +34 -0
  63. package/src/types/index.ts +11 -0
  64. package/src/types/layout-types.ts +33 -0
  65. package/src/types/route-types.ts +24 -0
  66. package/src/types/shell-context.ts +36 -0
  67. package/src/types/theme-types.ts +14 -0
  68. package/tsconfig.json +20 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Layout Types
3
+ * Type definitions for layout and responsive design
4
+ */
5
+ export type LayoutArea = 'header' | 'sidebar' | 'main' | 'footer' | 'overlay';
6
+ export interface LayoutSlot {
7
+ /** Slot identifier */
8
+ id: string;
9
+ /** Slot position/area */
10
+ area: LayoutArea;
11
+ /** Slot priority for ordering */
12
+ priority?: number;
13
+ /** Optional metadata */
14
+ meta?: Record<string, any>;
15
+ }
16
+ export interface ViewportInfo {
17
+ width: number;
18
+ height: number;
19
+ isMobile: boolean;
20
+ isTablet: boolean;
21
+ isDesktop: boolean;
22
+ }
23
+ export type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
24
+ export interface Breakpoint {
25
+ name: BreakpointName;
26
+ minWidth: number;
27
+ maxWidth?: number;
28
+ }
29
+ //# sourceMappingURL=layout-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-types.d.ts","sourceRoot":"","sources":["../../src/types/layout-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9E,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEtE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Layout Types
3
+ * Type definitions for layout and responsive design
4
+ */
5
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Route Types
3
+ * Type definitions for routing
4
+ */
5
+ export interface RouteConfig {
6
+ path: string;
7
+ /** Lazy-loaded component factory */
8
+ component: () => Promise<any>;
9
+ /** Route metadata */
10
+ meta?: Record<string, any>;
11
+ /** Child routes */
12
+ children?: RouteConfig[];
13
+ /** Route guards */
14
+ beforeEnter?: (to: RouteConfig, from: RouteConfig) => boolean | Promise<boolean>;
15
+ }
16
+ export type RouterMode = 'history' | 'hash' | 'memory';
17
+ export interface RouterOptions {
18
+ routes: RouteConfig[];
19
+ mode?: RouterMode;
20
+ base?: string;
21
+ }
22
+ //# sourceMappingURL=route-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-types.d.ts","sourceRoot":"","sources":["../../src/types/route-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,mBAAmB;IACnB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,mBAAmB;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClF;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Route Types
3
+ * Type definitions for routing
4
+ */
5
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shell Context Types
3
+ * Type definitions for shell context
4
+ */
5
+ import type { ThemeMode, ThemeConfig } from './theme-types';
6
+ import type { FeatureFlags } from './feature-types';
7
+ import type { ViewportInfo } from './layout-types';
8
+ export interface ShellConfig {
9
+ /** Theme configuration */
10
+ theme?: ThemeConfig;
11
+ /** Feature flags and experimental configurations */
12
+ features?: FeatureFlags;
13
+ /** Enable server-side rendering */
14
+ ssr?: boolean;
15
+ /** Enable streaming rendering */
16
+ streaming?: boolean;
17
+ /** Custom shell metadata */
18
+ metadata?: Record<string, any>;
19
+ }
20
+ export interface ShellContext {
21
+ /** Current theme mode */
22
+ theme: ThemeMode;
23
+ /** Set theme mode */
24
+ setTheme: (mode: ThemeMode) => void;
25
+ /** Feature flags */
26
+ features: FeatureFlags;
27
+ /** Check if a feature is enabled */
28
+ isFeatureEnabled: (key: string) => boolean;
29
+ /** Get feature value */
30
+ getFeature: <T = any>(key: string, defaultValue?: T) => T;
31
+ /** Current viewport size */
32
+ viewport: ViewportInfo;
33
+ }
34
+ //# sourceMappingURL=shell-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-context.d.ts","sourceRoot":"","sources":["../../src/types/shell-context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,mCAAmC;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,qBAAqB;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,oBAAoB;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,oCAAoC;IACpC,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,wBAAwB;IACxB,UAAU,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1D,4BAA4B;IAC5B,QAAQ,EAAE,YAAY,CAAC;CACxB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shell Context Types
3
+ * Type definitions for shell context
4
+ */
5
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Theme Types
3
+ * Type definitions for theme management
4
+ */
5
+ export type ThemeMode = 'light' | 'dark' | 'system';
6
+ export interface ThemeConfig {
7
+ mode: ThemeMode;
8
+ /** Primary color scheme */
9
+ primaryColor?: string;
10
+ /** Custom CSS variables */
11
+ cssVariables?: Record<string, string>;
12
+ }
13
+ //# sourceMappingURL=theme-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-types.d.ts","sourceRoot":"","sources":["../../src/types/theme-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Theme Types
3
+ * Type definitions for theme management
4
+ */
5
+ export {};
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@hamak/ui-shell-api",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "UI Shell API - Core UI shell interfaces",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/amah/app-framework.git",
13
+ "directory": "packages/ui-shell/ui-shell-api"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.json",
20
+ "clean": "rm -rf dist"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js"
26
+ }
27
+ },
28
+ "devDependencies": {
29
+ "typescript": "~5.4.0"
30
+ }
31
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Feature Manager Interface
3
+ * Public API contract for feature flag management
4
+ */
5
+
6
+ import type { FeatureFlags } from '../types';
7
+
8
+ export interface IFeatureManager {
9
+ /**
10
+ * Check if a feature is enabled (boolean features)
11
+ */
12
+ isEnabled(key: string): boolean;
13
+
14
+ /**
15
+ * Get a feature value with optional default
16
+ */
17
+ get<T = any>(key: string, defaultValue?: T): T;
18
+
19
+ /**
20
+ * Set a feature value
21
+ */
22
+ set(key: string, value: any): void;
23
+
24
+ /**
25
+ * Enable a feature (set to true)
26
+ */
27
+ enable(key: string): void;
28
+
29
+ /**
30
+ * Disable a feature (set to false)
31
+ */
32
+ disable(key: string): void;
33
+
34
+ /**
35
+ * Toggle a boolean feature
36
+ */
37
+ toggle(key: string): void;
38
+
39
+ /**
40
+ * Update multiple features at once
41
+ */
42
+ update(updates: FeatureFlags): void;
43
+
44
+ /**
45
+ * Get all features
46
+ */
47
+ getAll(): Readonly<FeatureFlags>;
48
+
49
+ /**
50
+ * Check if a feature exists
51
+ */
52
+ has(key: string): boolean;
53
+
54
+ /**
55
+ * Subscribe to feature changes
56
+ */
57
+ subscribe(key: string, listener: (value: any) => void): () => void;
58
+
59
+ /**
60
+ * Subscribe to all feature changes
61
+ */
62
+ subscribeAll(listener: (key: string, value: any) => void): () => void;
63
+
64
+ /**
65
+ * Clean up resources
66
+ */
67
+ destroy(): void;
68
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Layout Manager Interface
3
+ * Public API contract for layout management
4
+ */
5
+
6
+ import type { LayoutSlot, LayoutArea } from '../types';
7
+
8
+ export interface ILayoutManager {
9
+ /**
10
+ * Register a layout slot
11
+ */
12
+ registerSlot(slot: LayoutSlot): () => void;
13
+
14
+ /**
15
+ * Unregister a layout slot
16
+ */
17
+ unregisterSlot(slot: LayoutSlot): void;
18
+
19
+ /**
20
+ * Get all slots for an area
21
+ */
22
+ getSlots(area: LayoutArea): LayoutSlot[];
23
+
24
+ /**
25
+ * Get all registered areas
26
+ */
27
+ getAreas(): LayoutArea[];
28
+
29
+ /**
30
+ * Check if an area has any slots
31
+ */
32
+ hasSlots(area: LayoutArea): boolean;
33
+
34
+ /**
35
+ * Subscribe to layout changes
36
+ */
37
+ subscribe(listener: () => void): () => void;
38
+
39
+ /**
40
+ * Clear all slots
41
+ */
42
+ clear(): void;
43
+
44
+ /**
45
+ * Clean up resources
46
+ */
47
+ destroy(): void;
48
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Router Interface
3
+ * Public API contract for routing
4
+ */
5
+
6
+ import type { RouteConfig } from '../types';
7
+
8
+ export interface IRouter {
9
+ /**
10
+ * Navigate to a path
11
+ */
12
+ push(path: string): Promise<boolean>;
13
+
14
+ /**
15
+ * Replace current route
16
+ */
17
+ replace(path: string): Promise<boolean>;
18
+
19
+ /**
20
+ * Go back in history
21
+ */
22
+ back(): void;
23
+
24
+ /**
25
+ * Go forward in history
26
+ */
27
+ forward(): void;
28
+
29
+ /**
30
+ * Get current route
31
+ */
32
+ getCurrentRoute(): RouteConfig | null;
33
+
34
+ /**
35
+ * Subscribe to route changes
36
+ */
37
+ subscribe(listener: (route: RouteConfig) => void): () => void;
38
+
39
+ /**
40
+ * Load a route component (lazy loading)
41
+ */
42
+ loadRouteComponent(route: RouteConfig): Promise<any>;
43
+
44
+ /**
45
+ * Clean up resources
46
+ */
47
+ destroy(): void;
48
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Shell Interface
3
+ * Public API contract for the UI Shell
4
+ */
5
+
6
+ import type { ShellConfig, ShellContext, ShellEvent, ShellEventListener, ShellEventType } from '../types';
7
+ import type { IThemeManager } from './IThemeManager';
8
+ import type { IFeatureManager } from './IFeatureManager';
9
+ import type { IRouter } from './IRouter';
10
+
11
+ export interface IShell {
12
+ /**
13
+ * Initialize the shell
14
+ */
15
+ initialize(): Promise<void>;
16
+
17
+ /**
18
+ * Get shell context for consumers
19
+ */
20
+ getContext(): ShellContext;
21
+
22
+ /**
23
+ * Get theme manager
24
+ */
25
+ getThemeManager(): IThemeManager;
26
+
27
+ /**
28
+ * Get feature manager
29
+ */
30
+ getFeatureManager(): IFeatureManager;
31
+
32
+ /**
33
+ * Get router instance
34
+ */
35
+ getRouter(): IRouter | null;
36
+
37
+ /**
38
+ * Emit a shell event
39
+ */
40
+ emit(type: ShellEventType, payload?: any): void;
41
+
42
+ /**
43
+ * Subscribe to shell events
44
+ */
45
+ on(type: ShellEventType | '*', listener: ShellEventListener): () => void;
46
+
47
+ /**
48
+ * Unsubscribe from shell events
49
+ */
50
+ off(type: ShellEventType | '*', listener: ShellEventListener): void;
51
+
52
+ /**
53
+ * Check if shell is ready
54
+ */
55
+ ready(): boolean;
56
+
57
+ /**
58
+ * Get configuration
59
+ */
60
+ getConfig(): Readonly<ShellConfig>;
61
+
62
+ /**
63
+ * Clean up resources
64
+ */
65
+ destroy(): void;
66
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Theme Manager Interface
3
+ * Public API contract for theme management
4
+ */
5
+
6
+ import type { ThemeMode } from '../types';
7
+
8
+ export interface IThemeManager {
9
+ /**
10
+ * Get the current theme mode
11
+ */
12
+ getTheme(): ThemeMode;
13
+
14
+ /**
15
+ * Get the resolved theme (converts 'system' to actual theme)
16
+ */
17
+ getResolvedTheme(): 'light' | 'dark';
18
+
19
+ /**
20
+ * Set the theme mode
21
+ */
22
+ setTheme(mode: ThemeMode): void;
23
+
24
+ /**
25
+ * Toggle between light and dark themes
26
+ */
27
+ toggleTheme(): void;
28
+
29
+ /**
30
+ * Subscribe to theme changes
31
+ */
32
+ subscribe(listener: (theme: ThemeMode) => void): () => void;
33
+
34
+ /**
35
+ * Apply custom CSS variables
36
+ */
37
+ setCSSVariables(variables: Record<string, string>): void;
38
+
39
+ /**
40
+ * Clean up resources
41
+ */
42
+ destroy(): void;
43
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * UI Shell API Interfaces
3
+ * All public interface definitions
4
+ */
5
+
6
+ export * from './IShell';
7
+ export * from './IThemeManager';
8
+ export * from './IFeatureManager';
9
+ export * from './IRouter';
10
+ export * from './ILayoutManager';
package/src/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * UI Shell API
3
+ * Public API surface for the UI Shell framework
4
+ *
5
+ * This package contains only type definitions and interfaces.
6
+ * Import implementations from @amk/ui-shell-impl
7
+ */
8
+
9
+ export const version = '0.1.0';
10
+
11
+ // Export all types
12
+ export * from './types';
13
+
14
+ // Export all API interfaces
15
+ export * from './api';
16
+
17
+ // Export service tokens
18
+ export * from './tokens';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Tokens
3
+ * Export all service tokens
4
+ */
5
+
6
+ export * from './service-tokens';
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Service Tokens
3
+ * Dependency injection tokens for shell services
4
+ */
5
+
6
+ /**
7
+ * Token for Shell service
8
+ */
9
+ export const SHELL_TOKEN = Symbol('Shell');
10
+
11
+ /**
12
+ * Token for ThemeManager service
13
+ */
14
+ export const THEME_MANAGER_TOKEN = Symbol('ThemeManager');
15
+
16
+ /**
17
+ * Token for FeatureManager service
18
+ */
19
+ export const FEATURE_MANAGER_TOKEN = Symbol('FeatureManager');
20
+
21
+ /**
22
+ * Token for Router service
23
+ */
24
+ export const ROUTER_TOKEN = Symbol('Router');
25
+
26
+ /**
27
+ * Token for LayoutManager service
28
+ */
29
+ export const LAYOUT_MANAGER_TOKEN = Symbol('LayoutManager');
30
+
31
+ /**
32
+ * Shell command names
33
+ */
34
+ export const ShellCommands = {
35
+ SET_THEME: 'shell.setTheme',
36
+ TOGGLE_THEME: 'shell.toggleTheme',
37
+ ENABLE_FEATURE: 'shell.enableFeature',
38
+ DISABLE_FEATURE: 'shell.disableFeature',
39
+ TOGGLE_FEATURE: 'shell.toggleFeature',
40
+ NAVIGATE: 'shell.navigate',
41
+ NAVIGATE_BACK: 'shell.navigateBack',
42
+ } as const;
43
+
44
+ /**
45
+ * Shell event names
46
+ */
47
+ export const ShellEvents = {
48
+ READY: 'shell:ready',
49
+ THEME_CHANGED: 'shell:theme-changed',
50
+ FEATURE_TOGGLED: 'shell:feature-toggled',
51
+ ROUTE_CHANGED: 'shell:route-changed',
52
+ VIEWPORT_RESIZED: 'shell:viewport-resized',
53
+ } as const;
54
+
55
+ /**
56
+ * Shell view slot names
57
+ */
58
+ export const ShellViewSlots = {
59
+ HEADER: 'shell.header',
60
+ SIDEBAR: 'shell.sidebar',
61
+ MAIN: 'shell.main',
62
+ FOOTER: 'shell.footer',
63
+ OVERLAY: 'shell.overlay',
64
+ } as const;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Event Types
3
+ * Type definitions for shell events
4
+ */
5
+
6
+ export type ShellEventType =
7
+ | 'theme:changed'
8
+ | 'feature:toggled'
9
+ | 'route:changed'
10
+ | 'viewport:resized'
11
+ | 'shell:ready'
12
+ | 'shell:error';
13
+
14
+ export interface ShellEvent {
15
+ type: string;
16
+ payload?: any;
17
+ timestamp: number;
18
+ }
19
+
20
+ export interface ShellEventListener {
21
+ (event: ShellEvent): void;
22
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Feature Types
3
+ * Type definitions for feature flag management
4
+ */
5
+
6
+ export interface FeatureFlags {
7
+ [key: string]: boolean | string | number | object;
8
+ }
9
+
10
+ /**
11
+ * Common feature flag definitions
12
+ */
13
+ export const CommonFeatures = {
14
+ // UI Features
15
+ DARK_MODE: 'ui.darkMode',
16
+ SIDEBAR: 'ui.sidebar',
17
+ MOBILE_NAV: 'ui.mobileNav',
18
+ BREADCRUMBS: 'ui.breadcrumbs',
19
+
20
+ // Experimental Features
21
+ SSR: 'experimental.ssr',
22
+ STREAMING: 'experimental.streaming',
23
+ LAZY_LOADING: 'experimental.lazyLoading',
24
+
25
+ // User Features
26
+ VOICE_MODE: 'user.voiceMode',
27
+ ADVANCED_COMPOSER: 'user.advancedComposer',
28
+ UPGRADE_PILLS: 'user.upgradePills',
29
+
30
+ // Performance Features
31
+ REQUEST_RETRY: 'performance.requestRetry',
32
+ POLLING: 'performance.polling',
33
+ CACHE: 'performance.cache',
34
+ } as const;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * UI Shell API Types
3
+ * All public type definitions
4
+ */
5
+
6
+ export * from './theme-types';
7
+ export * from './feature-types';
8
+ export * from './route-types';
9
+ export * from './layout-types';
10
+ export * from './event-types';
11
+ export * from './shell-context';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Layout Types
3
+ * Type definitions for layout and responsive design
4
+ */
5
+
6
+ export type LayoutArea = 'header' | 'sidebar' | 'main' | 'footer' | 'overlay';
7
+
8
+ export interface LayoutSlot {
9
+ /** Slot identifier */
10
+ id: string;
11
+ /** Slot position/area */
12
+ area: LayoutArea;
13
+ /** Slot priority for ordering */
14
+ priority?: number;
15
+ /** Optional metadata */
16
+ meta?: Record<string, any>;
17
+ }
18
+
19
+ export interface ViewportInfo {
20
+ width: number;
21
+ height: number;
22
+ isMobile: boolean;
23
+ isTablet: boolean;
24
+ isDesktop: boolean;
25
+ }
26
+
27
+ export type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
28
+
29
+ export interface Breakpoint {
30
+ name: BreakpointName;
31
+ minWidth: number;
32
+ maxWidth?: number;
33
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Route Types
3
+ * Type definitions for routing
4
+ */
5
+
6
+ export interface RouteConfig {
7
+ path: string;
8
+ /** Lazy-loaded component factory */
9
+ component: () => Promise<any>;
10
+ /** Route metadata */
11
+ meta?: Record<string, any>;
12
+ /** Child routes */
13
+ children?: RouteConfig[];
14
+ /** Route guards */
15
+ beforeEnter?: (to: RouteConfig, from: RouteConfig) => boolean | Promise<boolean>;
16
+ }
17
+
18
+ export type RouterMode = 'history' | 'hash' | 'memory';
19
+
20
+ export interface RouterOptions {
21
+ routes: RouteConfig[];
22
+ mode?: RouterMode;
23
+ base?: string;
24
+ }