@histoire/shared 0.9.1 → 0.9.2

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
@@ -1,3 +1,4 @@
1
1
  export * from './codegen/index.js';
2
2
  export * from './types.js';
3
3
  export * from './state.js';
4
+ export * from './type-utils.js';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './codegen/index.js';
2
2
  export * from './types.js';
3
3
  export * from './state.js';
4
+ export * from './type-utils.js';
@@ -0,0 +1 @@
1
+ export declare type Awaitable<T> = Promise<T> | T;
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.d.ts CHANGED
@@ -12,6 +12,25 @@ export declare type StoryLayout = {
12
12
  type: 'grid';
13
13
  width?: number | string;
14
14
  };
15
+ export interface CommonProps {
16
+ id?: string;
17
+ title?: string;
18
+ icon?: string;
19
+ iconColor?: string;
20
+ }
21
+ export interface InheritedProps {
22
+ setupApp?: (payload: any) => unknown;
23
+ source?: string;
24
+ responsiveDisabled?: boolean;
25
+ autoPropsDisabled?: boolean;
26
+ }
27
+ export interface VariantProps extends CommonProps, InheritedProps {
28
+ }
29
+ export interface StoryProps extends CommonProps, InheritedProps {
30
+ group?: string;
31
+ layout?: StoryLayout;
32
+ docsOnly?: boolean;
33
+ }
15
34
  export interface Story {
16
35
  id: string;
17
36
  title: string;
@@ -23,7 +42,7 @@ export interface Story {
23
42
  docsOnly?: boolean;
24
43
  file?: StoryFile;
25
44
  lastSelectedVariant?: Variant;
26
- slots?: () => Readonly<any>;
45
+ slots?: () => any;
27
46
  }
28
47
  export interface Variant {
29
48
  id: string;
@@ -31,7 +50,10 @@ export interface Variant {
31
50
  icon?: string;
32
51
  iconColor?: string;
33
52
  setupApp?: (payload: any) => unknown;
34
- slots?: () => Readonly<any>;
53
+ slots?: () => {
54
+ default: any;
55
+ controls: any;
56
+ };
35
57
  state: any;
36
58
  source?: string;
37
59
  responsiveDisabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@histoire/shared",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Shared utilities for Histoire",
5
5
  "license": "MIT",
6
6
  "author": {
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './codegen/index.js'
2
2
  export * from './types.js'
3
3
  export * from './state.js'
4
+ export * from './type-utils.js'
@@ -0,0 +1 @@
1
+ export type Awaitable<T> = Promise<T> | T
package/src/types.ts CHANGED
@@ -14,6 +14,30 @@ export type StoryLayout = {
14
14
  width?: number | string
15
15
  }
16
16
 
17
+ export interface CommonProps {
18
+ id?: string
19
+ title?: string
20
+ icon?: string
21
+ iconColor?: string
22
+ }
23
+
24
+ export interface InheritedProps {
25
+ setupApp?: (payload: any) => unknown
26
+ source?: string
27
+ responsiveDisabled?: boolean
28
+ autoPropsDisabled?: boolean
29
+ }
30
+
31
+ export interface VariantProps extends CommonProps, InheritedProps {
32
+ // No additional properties
33
+ }
34
+
35
+ export interface StoryProps extends CommonProps, InheritedProps {
36
+ group?: string
37
+ layout?: StoryLayout
38
+ docsOnly?: boolean
39
+ }
40
+
17
41
  export interface Story {
18
42
  id: string
19
43
  title: string
@@ -25,7 +49,7 @@ export interface Story {
25
49
  docsOnly?: boolean
26
50
  file?: StoryFile
27
51
  lastSelectedVariant?: Variant
28
- slots?: () => Readonly<any>
52
+ slots?: () => any
29
53
  }
30
54
 
31
55
  export interface Variant {
@@ -34,7 +58,7 @@ export interface Variant {
34
58
  icon?: string
35
59
  iconColor?: string
36
60
  setupApp?: (payload: any) => unknown
37
- slots?: () => Readonly<any>
61
+ slots?: () => { default: any, controls: any }
38
62
  state: any
39
63
  source?: string
40
64
  responsiveDisabled?: boolean
@@ -152,7 +176,6 @@ export interface SupportPlugin {
152
176
  importStoryComponent: (file: ServerStoryFile, index: number) => string
153
177
  }
154
178
 
155
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
156
179
  export interface FinalSupportPlugin extends SupportPlugin {
157
180
  // For now, no additional properties
158
181
  }