mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(ui): clean up unused code 5
variables, types and schemas
This commit is contained in:
@ -11,13 +11,6 @@ export type MetadataRenderValueFunc<T> = (value: T) => Promise<React.ReactNode>;
|
||||
*/
|
||||
export type MetadataGetLabelFunc = () => string;
|
||||
|
||||
export type MetadataParseOptions = {
|
||||
toastOnFailure?: boolean;
|
||||
toastOnSuccess?: boolean;
|
||||
};
|
||||
|
||||
export type MetadataRecallOptions = MetadataParseOptions;
|
||||
|
||||
/**
|
||||
* A function that recalls a parsed and validated metadata value.
|
||||
*
|
||||
@ -119,7 +112,7 @@ export type MetadataHandlers<TValue = unknown, TItem = unknown> = {
|
||||
// type MetadataHandlersInferItem<TValue> = TValue extends Array<infer TItem> ? MetadataParseFunc<TItem> : never
|
||||
// While this works for the types as expected, I couldn't satisfy TS in the implementations of the handlers.
|
||||
|
||||
export type BuildMetadataHandlersArg<TValue, TItem> = {
|
||||
type BuildMetadataHandlersArg<TValue, TItem> = {
|
||||
parser: MetadataParseFunc<TValue>;
|
||||
itemParser?: MetadataParseFunc<TItem>;
|
||||
recaller?: MetadataRecallFunc<TValue>;
|
||||
|
@ -7,7 +7,7 @@ import type { AnyModelConfig, BaseModelType, ModelType } from 'services/api/type
|
||||
/**
|
||||
* Raised when a model config is unable to be fetched.
|
||||
*/
|
||||
export class ModelConfigNotFoundError extends Error {
|
||||
class ModelConfigNotFoundError extends Error {
|
||||
/**
|
||||
* Create ModelConfigNotFoundError
|
||||
* @param {String} message
|
||||
@ -58,11 +58,7 @@ export const fetchModelConfig = async (key: string): Promise<AnyModelConfig> =>
|
||||
* @returns A promise that resolves to the model config.
|
||||
* @throws {ModelConfigNotFoundError} If the model config is unable to be fetched.
|
||||
*/
|
||||
export const fetchModelConfigByAttrs = async (
|
||||
name: string,
|
||||
base: BaseModelType,
|
||||
type: ModelType
|
||||
): Promise<AnyModelConfig> => {
|
||||
const fetchModelConfigByAttrs = async (name: string, base: BaseModelType, type: ModelType): Promise<AnyModelConfig> => {
|
||||
const { dispatch } = getStore();
|
||||
try {
|
||||
const req = dispatch(modelsApi.endpoints.getModelConfigByAttrs.initiate({ name, base, type }));
|
||||
|
@ -78,7 +78,7 @@ export const MetadataParseFailedToken = Symbol('failed');
|
||||
/**
|
||||
* Raised when metadata parsing fails.
|
||||
*/
|
||||
export class MetadataParseError extends Error {
|
||||
class MetadataParseError extends Error {
|
||||
/**
|
||||
* Create MetadataParseError
|
||||
* @param {String} message
|
||||
|
Reference in New Issue
Block a user