@@ -522,6 +522,16 @@ export function createExtensionInput<
|
||||
}
|
||||
>;
|
||||
|
||||
// @public
|
||||
export function createExtensionKind<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
>(
|
||||
options: ExtensionKindOptions<TProps, TInputs, TOutput, TConfig>,
|
||||
): ExtensionKind<TProps, TInputs, TOutput, TConfig>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface CreateExtensionOptions<
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
@@ -913,6 +923,91 @@ export interface ExtensionInput<
|
||||
extensionData: TExtensionData;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class ExtensionKind<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
static create<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
>(
|
||||
options: ExtensionKindOptions<TProps, TInputs, TOutput, TConfig>,
|
||||
): ExtensionKind<TProps, TInputs, TOutput, TConfig>;
|
||||
// (undocumented)
|
||||
new(options: {
|
||||
namespace?: string;
|
||||
name?: string;
|
||||
attachTo?: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
disabled?: boolean;
|
||||
inputs?: TInputs;
|
||||
output?: TOutput;
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
props: TProps;
|
||||
factory?(
|
||||
options: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
orignalFactory(
|
||||
options?: {
|
||||
node?: AppNode;
|
||||
config?: TConfig;
|
||||
inputs?: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
props?: TProps,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
},
|
||||
props: TProps,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
}): ExtensionDefinition<TConfig>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionKindOptions<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
TConfig,
|
||||
> {
|
||||
// (undocumented)
|
||||
attachTo: {
|
||||
id: string;
|
||||
input: string;
|
||||
};
|
||||
// (undocumented)
|
||||
configSchema?: PortableSchema<TConfig>;
|
||||
// (undocumented)
|
||||
disabled?: boolean;
|
||||
// (undocumented)
|
||||
factory(
|
||||
options: {
|
||||
node: AppNode;
|
||||
config: TConfig;
|
||||
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
},
|
||||
props: TProps,
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
// (undocumented)
|
||||
inputs?: TInputs;
|
||||
// (undocumented)
|
||||
kind: string;
|
||||
// (undocumented)
|
||||
name?: string;
|
||||
// (undocumented)
|
||||
namespace?: string;
|
||||
// (undocumented)
|
||||
output: TOutput;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ExtensionOverrides {
|
||||
// (undocumented)
|
||||
|
||||
@@ -24,7 +24,11 @@ import {
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
interface ExtensionKindOptions<
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ExtensionKindOptions<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
@@ -48,7 +52,10 @@ interface ExtensionKindOptions<
|
||||
): Expand<ExtensionDataValues<TOutput>>;
|
||||
}
|
||||
|
||||
class ExtensionKind<
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class ExtensionKind<
|
||||
TProps,
|
||||
TInputs extends AnyExtensionInputMap,
|
||||
TOutput extends AnyExtensionDataMap,
|
||||
@@ -153,6 +160,8 @@ class ExtensionKind<
|
||||
/**
|
||||
* A simpler replacement for wrapping up `createExtension` inside a kind or type. This allows for a cleaner API for creating
|
||||
* types and instances of those types.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export function createExtensionKind<
|
||||
TProps,
|
||||
|
||||
@@ -48,3 +48,8 @@ export {
|
||||
type FeatureFlagConfig,
|
||||
type FrontendFeature,
|
||||
} from './types';
|
||||
export {
|
||||
type ExtensionKindOptions,
|
||||
ExtensionKind,
|
||||
createExtensionKind,
|
||||
} from './createExtensionKind';
|
||||
|
||||
Reference in New Issue
Block a user