UNPKG

ionic-coreo

Version:

Ionic2 module for integration with Coreo

40 lines (39 loc) 1.07 kB
/// <reference types="promise.prototype.finally" /> export declare type ICoreoRecordData = any; export interface ICoreoRecord { id?: number; lat?: number; lng?: number; surveyId: number; typeId?: number; data?: ICoreoRecordData; records?: CoreoRecord[]; } export interface ICoreoRecordFile { url: string; path: string; type?: string; } export declare class CoreoRecord implements ICoreoRecord { lat?: number; lng?: number; surveyId: number; typeId?: number; data: ICoreoRecordData; records: CoreoRecord[]; private files; constructor(options?: ICoreoRecord); setData(key: string, value: string): void; addFile(path: string, url: string, type?: string): void; private loadFiles(); private dataWithFiles(); /** * Convert the record to a FormData object ready for upload */ toFormData(): Promise<FormData>; createChildRecord(options?: ICoreoRecord): CoreoRecord; /** * Load a file from the filesystem into a blob */ private loadFile(file); }