@spartacus/cart
Version:
`@spartacus/cart` is a package that you can include in your application, which allows you to use various cart features.
60 lines (59 loc) • 1.5 kB
TypeScript
import { OrderEntriesSource } from '@spartacus/storefront';
/**
* Indicates from which source the new saved cart name
* should be taken.
*/
export declare enum CartNameSource {
FILE_NAME = "fileName",
DATE_TIME = "dateTime"
}
/**
* Specifies cart name generation details.
*/
export interface CartNameGeneration {
/**
* If `source` is set as `DATE_TIME`, it means that by default
* new saved cart name will be set as current date according to `fromDateOptions` property.
*/
source?: CartNameSource;
fromDateOptions?: {
/**
* Adds text before the import date.
*/
prefix?: string;
/**
* Adds text after the import date.
*/
suffix?: string;
/**
* Transforms current date according to specified format.
*/
mask?: string;
};
}
/**
* Allows to specify file validation attributes.
*/
export interface FileValidity {
/**
* Maximum imported file size in megabytes.
*/
maxSize?: number;
/**
* Maximum number for imported entries per place specified as key from `OrderEntriesSource`.
*/
maxEntries?: {
[]?: number;
};
/**
* String array with file types/extensions allowed for import.
*/
allowedTypes?: string[];
}
/**
* Interface for import config.
*/
export interface ImportConfig {
fileValidity?: FileValidity;
cartNameGeneration?: CartNameGeneration;
}