@botonic/plugin-contentful
Version:
Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet
35 lines (34 loc) • 1.37 kB
TypeScript
import { Entry } from 'contentful';
import { Context, ScheduleContent } from '../../cms';
import { DeliveryApi } from '../delivery-api';
import { CommonEntryFields, ContentWithNameFields } from '../delivery-utils';
import { DeliveryWithReference } from './reference';
export declare class ScheduleDelivery extends DeliveryWithReference {
static REFERENCES_INCLUDE: number;
constructor(delivery: DeliveryApi, resumeErrors: boolean);
schedule(id: string, context: Context): Promise<ScheduleContent>;
fromEntry(entry: Entry<ScheduleFields>, context: Context): Promise<ScheduleContent>;
private addDaySchedules;
private createDaySchedule;
private addExceptions;
}
export interface ScheduleFields extends CommonEntryFields {
mondays?: Entry<HourRangeFields>[];
tuesdays?: Entry<HourRangeFields>[];
wednesdays?: Entry<HourRangeFields>[];
thursdays?: Entry<HourRangeFields>[];
fridays?: Entry<HourRangeFields>[];
saturdays?: Entry<HourRangeFields>[];
sundays?: Entry<HourRangeFields>[];
exceptions?: Entry<DayScheduleFields>[];
}
export interface DayScheduleFields extends ContentWithNameFields {
date: string;
hourRanges: Entry<HourRangeFields>[];
}
export interface HourRangeFields extends ContentWithNameFields {
fromHour: number;
fromMinute: number;
toHour: number;
toMinute: number;
}