Interface Asset<Modifiers, Locales>

Assets are binary files in a Contentful space

interface Asset<Modifiers, Locales> {
    fields: ChainModifiers extends Modifiers
        ? AssetFields | {
            description?: {
                [LocaleName in string]?: string
            };
            file?: {
                [LocaleName in string]?: AssetFile
            };
            title?: {
                [LocaleName in string]?: string
            };
        }
        : "WITH_ALL_LOCALES" extends Modifiers
            ? {
                description?: {
                    [LocaleName in string]?: string
                };
                file?: {
                    [LocaleName in string]?: AssetFile
                };
                title?: {
                    [LocaleName in string]?: string
                };
            }
            : AssetFields;
    metadata: Metadata;
    sys: AssetSys;
}

Type Parameters

  • Modifiers extends ChainModifiers = ChainModifiers

    The chain modifiers used to configure the client. They’re set automatically when using the client chain modifiers.

  • Locales extends LocaleCode = LocaleCode

    If provided for a client using allLocales modifier, response type defines locale keys for asset field values.

Properties

Properties

fields: ChainModifiers extends Modifiers
    ? AssetFields | {
        description?: {
            [LocaleName in string]?: string
        };
        file?: {
            [LocaleName in string]?: AssetFile
        };
        title?: {
            [LocaleName in string]?: string
        };
    }
    : "WITH_ALL_LOCALES" extends Modifiers
        ? {
            description?: {
                [LocaleName in string]?: string
            };
            file?: {
                [LocaleName in string]?: AssetFile
            };
            title?: {
                [LocaleName in string]?: string
            };
        }
        : AssetFields
metadata: Metadata