1.0.0 • Published 6 years ago

private-data-container-interface v1.0.0

Weekly downloads
5
License
FREE
Repository
-
Last release
6 years ago

This is a Typescript interface with two methods: import() and export()

The idea is to have any class that manipulates private data that you should eventually have access to (after the manipulations are complete) implement this interface. The only way to pass new data into the class would be with import(), and the only way to get it back would be with export().

To include in your project:

import { IPrivateDataContainer } from 'private-data-container-interface/IPrivateDataContainer';

Usage examples:

export class PrivateArrayContainer implements IPrivateDataContainer<any[]> {...}

export class PrivateStringContainer implements IPrivateDataContainer\ {...}

import() must follow this implementation:

import(data: Type, ...args): any;

export must follow this implementation:

export(): Type;