sanity-plugin-icon-picker-fix
Version:
An Icon Picker plugin for Sanity
34 lines (26 loc) • 781 B
text/typescript
import type { ReactElement } from 'react';
export interface IconPickerOptions {
providers?: string[];
outputFormat?: string;
filter?: (string | RegExp)[];
configurations?: ProviderConfiguration[];
}
export interface IconObject {
provider: string;
name: string;
component: () => ReactElement;
tags: string[];
}
export type ConfigurationIconObject = Omit<IconObject, 'provider'>;
type ConfigurationIconObjectArray = Array<ConfigurationIconObject>;
export type IconObjectArray = Array<IconObject>;
export type FormatFunction = (
name: string,
options: IconPickerOptions,
reactName?: string
) => string;
export interface ProviderConfiguration {
title: string;
provider: string;
icons: (options?: IconPickerOptions) => ConfigurationIconObjectArray;
}