@omniviewdev/runtime 0.2.1 → 0.2.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.
@@ -56,7 +56,7 @@ export type RegisterOpts<Props> = {
56
56
  /**
57
57
  * The component to render
58
58
  */
59
- component: React.Component<Props>;
59
+ component: React.ComponentType<Props>;
60
60
  /**
61
61
  * Additional optional metadata for the component
62
62
  */
@@ -99,6 +99,16 @@ export type CreateExtensionPointOptions<ComponentProps> = ExtensionPointSettings
99
99
  */
100
100
  matcher?: (context: ExtensionRenderContext, item: Registration<ComponentProps>) => boolean;
101
101
  };
102
+ /**
103
+ * A registration entry that a plugin exports to register a component into an extension point.
104
+ * The host app processes these at plugin load time.
105
+ */
106
+ export type ExtensionRegistration<Props = any> = {
107
+ /** The ID of the extension point to register into */
108
+ extensionPointId: string;
109
+ /** The registration options for the component */
110
+ registration: RegisterOpts<Props>;
111
+ };
102
112
  /**
103
113
  * A registry to hold an extension points registered extensions, providing type safe access to the components.
104
114
  *
@@ -146,7 +156,7 @@ export declare class ExtensionPointStore<ComponentProps> {
146
156
  * render(component);
147
157
  * }
148
158
  */
149
- get(id: string): import('react').Component<ComponentProps, {}, any> | undefined;
159
+ get(id: string): import('react').ComponentType<ComponentProps> | undefined;
150
160
  /**
151
161
  * Lists all registered components in the registry. Useful for debugging or generating summaries of available components.
152
162
  *
@@ -174,8 +184,8 @@ export declare class ExtensionPointStore<ComponentProps> {
174
184
  /**
175
185
  * Provide the components that match the given context.
176
186
  */
177
- provide(context: ExtensionRenderContext): Array<React.Component<ComponentProps>>;
178
- reorderComponents(components: Array<React.Component<ComponentProps>>, ids: string[], order: string[]): Array<React.Component<ComponentProps>>;
187
+ provide(context: ExtensionRenderContext): Array<React.ComponentType<ComponentProps>>;
188
+ reorderComponents(components: Array<React.ComponentType<ComponentProps>>, ids: string[], order: string[]): Array<React.ComponentType<ComponentProps>>;
179
189
  /**
180
190
  * Reorder the components in the registry based on the given order.
181
191
  */
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Types for the omniview/home/card extension point.
4
+ * Plugins that contribute homepage cards import these types.
5
+ */
6
+ export type HomepageCardSection = 'recent' | 'favorites' | 'folders' | (string & {});
7
+ export type HomepageCardConfig = {
8
+ sections: HomepageCardSection[];
9
+ maxItems?: number;
10
+ };
11
+ export type HomepageCardProps = {
12
+ pluginID: string;
13
+ config: HomepageCardConfig;
14
+ };
15
+ export type HomepageCardMeta = {
16
+ label: string;
17
+ description?: string;
18
+ defaultConfig: HomepageCardConfig;
19
+ defaultWidth?: 'small' | 'medium' | 'large';
20
+ /** Optional icon component rendered in the card header instead of the text label. */
21
+ icon?: React.ComponentType<{
22
+ size?: number;
23
+ color?: string;
24
+ }>;
25
+ };
@@ -2,3 +2,4 @@ export * from './app';
2
2
  export * from './plugin';
3
3
  export * from './extensions';
4
4
  export * from './watch';
5
+ export * from './homepage';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Omniview",
3
3
  "license": "AGPL-3.0-only",
4
4
  "name": "@omniviewdev/runtime",
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "description": "Runtime shared library for Omniview",
7
7
  "sideEffects": false,
8
8
  "type": "module",