import copy from 'fast-copy' ; import { freezeSys , toPlainObject } from 'contentful-sdk-core' ; import enhanceWithMethods from '../enhance-with-methods' ; import { wrapCollection } from '../common-utils' ; import { MetaSysProps , DefaultElements , MakeRequest } from '../common-types' ; export type SnapshotProps < T > = { sys : MetaSysProps & { snapshotType : string ; snapshotEntityType : string ; } ; snapshot : T ; } ; export interface Snapshot < T > extends SnapshotProps < T > , DefaultElements < SnapshotProps < T > > { } private function createSnapshotApi ( ) { return { } ; } private param makeRequest param data return export function wrapSnapshot < T > ( _makeRequest , data ) { const snapshot = toPlainObject ( copy ( data ) ) ; const snapshotWithMethods = enhanceWithMethods ( snapshot , createSnapshotApi ( ) ) ; return freezeSys ( snapshotWithMethods ) ; } private param makeRequest param data return export const wrapSnapshotCollection = wrapCollection ( wrapSnapshot ) ;