* introduce pako and add general packer interface

* add tests for packer

* use function API instead of class API for better tree shaking support

* refcatoring the rollup bundle config
This commit is contained in:
yz-yu
2020-04-07 18:03:47 +08:00
committed by GitHub
parent 18129bab70
commit 4f36d0e57d
23 changed files with 316 additions and 218 deletions

7
typings/packer/base.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { eventWithTime } from '../types';
export declare type PackFn = (event: eventWithTime) => string;
export declare type UnpackFn = (raw: string) => eventWithTime;
export declare type eventWithTimeAndPacker = eventWithTime & {
v: string;
};
export declare const MARK = "v1";

2
typings/packer/index.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export { pack } from './pack';
export { unpack } from './unpack';

2
typings/packer/pack.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
import { PackFn } from './base';
export declare const pack: PackFn;

2
typings/packer/unpack.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
import { UnpackFn } from './base';
export declare const unpack: UnpackFn;