文档
类型
IImageUserConfig

IImageUserConfig

interface IImageUserConfig<Tag extends TagGroupDefinition | null = TagGroupDefinition | null>
    extends CommonDisplayableConfig {
    /**
     * The name of the image, only for debugging purposes
     */
    name: string;
    /**
     * If set to false, the image won't be initialized unless you call `init` method
     * @default true
     */
    autoInit: boolean;
    /**
     * Image Src, see [Image](https://react.narraleaf.com/documentation/core/elements/image) for more information
     */
    src: ImageSrcType<Tag>;
    /**
     * Auto resize image's width to fit the screen
     * @default false
     */
    autoFit: boolean;
    /**
     * layer of the image
     */
    layer?: Layer;
}
type TagDefinition<T extends TagGroupDefinition | null> =
    T extends TagGroupDefinition ? TagDefinitionObject<T> : never;
type TagDefinitionObject<T extends TagGroupDefinition> = {
    groups: T;
    defaults: SelectElementFromEach<T>;
    resolve: TagSrcResolver<T>;
};
 
type ImageSrcType<T extends TagGroupDefinition | null = TagGroupDefinition | null> =
    T extends TagGroupDefinition ? TagDefinition<T> : (Color | ImageSrc);

For CommonDisplayableConfig, see CommonDisplayableConfig