@ccos/ccsdk-lite 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ export interface BusCache {
2
+ [busName: string]: Function[];
3
+ }
4
+ /**
5
+ * 简易实现的事件触发器
6
+ * 仅框架内部使用
7
+ * 未传入name时默认会有自增id作为name
8
+ * 主要为 定时器 bridge 等服务
9
+ */
10
+ export declare class Bus {
11
+ private _busId;
12
+ private _pool;
13
+ register(callback: Function, name?: string): string;
14
+ fire(name: string, ...args: any[]): any[];
15
+ has(name: string, callback?: Function): boolean;
16
+ remove(name: string, callback?: Function): void;
17
+ clear(): void;
18
+ }
19
+ declare const bus: Bus;
20
+ export default bus;
@@ -0,0 +1,7 @@
1
+ export declare function onCommandFromApp(cmd: string, payload: string): void;
2
+ export declare function setAppCommandCallback(cb: Function): void;
3
+ export declare function unsetAppCommandCallback(): void;
4
+ export declare function callNative(funcName: string, params: any): Promise<any>;
5
+ export declare function callWithPersistentCallBack(funcName: string, params: any, persistentIdName: string, callback: Function): Promise<any>;
6
+ export declare function deletePersistentCallBack(persistentIdName: string): void;
7
+ export declare function callbackFromNative(callbackId: string, data: string | object): void;
@@ -0,0 +1,53 @@
1
+ export declare function readAllContent(path: string, base64Flag?: boolean): Promise<any>;
2
+ export declare function writeAllContent(path: string, content: string, base64Flag?: boolean): Promise<any>;
3
+ export declare function getBaseDir(): Promise<any>;
4
+ export declare function getCacheDir(): Promise<any>;
5
+ export declare function makeCacheFile(fileName?: string): Promise<any>;
6
+ export declare function makeNormalFile(fileName?: string): Promise<any>;
7
+ export declare function exists(path: string): Promise<any>;
8
+ export declare function isFile(path: string): Promise<any>;
9
+ export declare function isDirectory(path: string): Promise<any>;
10
+ export declare function isHidden(path: string): Promise<any>;
11
+ export declare function canRead(path: string): Promise<any>;
12
+ export declare function canWrite(path: string): Promise<any>;
13
+ export declare function canExecute(path: string): Promise<any>;
14
+ export declare function lastModified(path: string): Promise<any>;
15
+ export declare function deleteIt(path: string): Promise<any>;
16
+ export declare function mkdir(path: string): Promise<any>;
17
+ export declare function mkdirs(path: string): Promise<any>;
18
+ export declare function rename(from: string, to: string): Promise<any>;
19
+ export declare function getAbsolutePath(path: string): Promise<any>;
20
+ export declare function createNewFile(path: string): Promise<any>;
21
+ export declare function setReadable(path: string, value?: boolean): Promise<any>;
22
+ export declare function setWritable(path: string, value?: boolean): Promise<any>;
23
+ export declare function setExecutable(path: string, value?: boolean): Promise<any>;
24
+ export declare function setLastModified(path: string, value?: number): Promise<any>;
25
+ export declare function list(path: string): Promise<any>;
26
+ declare const _default: {
27
+ readAllContent: typeof readAllContent;
28
+ writeAllContent: typeof writeAllContent;
29
+ getBaseDir: typeof getBaseDir;
30
+ getCacheDir: typeof getCacheDir;
31
+ makeCacheFile: typeof makeCacheFile;
32
+ makeNormalFile: typeof makeNormalFile;
33
+ exists: typeof exists;
34
+ isFile: typeof isFile;
35
+ isDirectory: typeof isDirectory;
36
+ isHidden: typeof isHidden;
37
+ canRead: typeof canRead;
38
+ canWrite: typeof canWrite;
39
+ canExecute: typeof canExecute;
40
+ lastModified: typeof lastModified;
41
+ deleteIt: typeof deleteIt;
42
+ mkdir: typeof mkdir;
43
+ mkdirs: typeof mkdirs;
44
+ rename: typeof rename;
45
+ getAbsolutePath: typeof getAbsolutePath;
46
+ createNewFile: typeof createNewFile;
47
+ setReadable: typeof setReadable;
48
+ setWritable: typeof setWritable;
49
+ setExecutable: typeof setExecutable;
50
+ setLastModified: typeof setLastModified;
51
+ list: typeof list;
52
+ };
53
+ export default _default;
@@ -0,0 +1,127 @@
1
+ export { setAppCommandCallback, unsetAppCommandCallback } from './core';
2
+ export declare function isRunInCooPark(): boolean;
3
+ declare const _default: {
4
+ network: {
5
+ simpleHttpRequest: typeof import("./network").simpleHttpRequest;
6
+ httpGet: typeof import("./network").httpGet;
7
+ httpPost: typeof import("./network").httpPost;
8
+ httpSseGet: typeof import("./network").httpSseGet;
9
+ getNetworkInfo: typeof import("./network").getNetworkInfo;
10
+ getDomainName: typeof import("./network").getDomainName;
11
+ getCommonHeader: typeof import("./network").getCommonHeader;
12
+ downloadToFile: typeof import("./network").downloadToFile;
13
+ };
14
+ app: {
15
+ startActivity: typeof import("./app").startActivity;
16
+ startService: typeof import("./app").startService;
17
+ sendBroadcast: typeof import("./app").sendBroadcast;
18
+ sendLocalBroadcast: typeof import("./app").sendLocalBroadcast;
19
+ startBackEndAction: typeof import("./app").startBackEndAction;
20
+ exitPage: typeof import("./app").exitPage;
21
+ moveTaskToBack: typeof import("./app").moveTaskToBack;
22
+ getUserInfo: typeof import("./app").getUserInfo;
23
+ setUserLogout: typeof import("./app").setUserLogout;
24
+ getAppList: typeof import("./app").getAppList;
25
+ getAppInfo: typeof import("./app").getAppInfo;
26
+ addLocalBroadcastHook: typeof import("./app").addLocalBroadcastHook;
27
+ deleteLocalBroadcastHook: typeof import("./app").deleteLocalBroadcastHook;
28
+ addBroadcastHook: typeof import("./app").addBroadcastHook;
29
+ deleteBroadcastHook: typeof import("./app").deleteBroadcastHook;
30
+ playAudio: typeof import("./app").playAudio;
31
+ stopAudio: typeof import("./app").stopAudio;
32
+ appPrivateMethod: typeof import("./app").appPrivateMethod;
33
+ };
34
+ system: {
35
+ getSdkVersion: typeof import("./system").getSdkVersion;
36
+ addLifeCycleHook: typeof import("./system").addLifeCycleHook;
37
+ deleteLifeCycleHook: typeof import("./system").deleteLifeCycleHook;
38
+ enableSystemKey: typeof import("./system").enableSystemKey;
39
+ getDeviceInfo: typeof import("./system").getDeviceInfo;
40
+ getProperty: typeof import("./system").getProperty;
41
+ getLocation: typeof import("./system").getLocation;
42
+ };
43
+ storage: {
44
+ setKey: typeof import("./storage").setKey;
45
+ getKey: typeof import("./storage").getKey;
46
+ deleteKey: typeof import("./storage").deleteKey;
47
+ clearAllKeys: typeof import("./storage").clearAllKeys;
48
+ };
49
+ androidView: {
50
+ startPagAni: typeof import("./androidView").startPagAni;
51
+ stopPagAni: typeof import("./androidView").stopPagAni;
52
+ sendTts: typeof import("./androidView").sendTts;
53
+ stopTts: typeof import("./androidView").stopTts;
54
+ sendStreamTts: typeof import("./androidView").sendStreamTts;
55
+ playerPlayNewUrl: typeof import("./androidView").playerPlayNewUrl;
56
+ playerStop: typeof import("./androidView").playerStop;
57
+ playerPause: typeof import("./androidView").playerPause;
58
+ playerStart: typeof import("./androidView").playerStart;
59
+ playerSeekTo: typeof import("./androidView").playerSeekTo;
60
+ playerHasPrepared: typeof import("./androidView").playerHasPrepared;
61
+ playerIsPlaying: typeof import("./androidView").playerIsPlaying;
62
+ playerGetDuration: typeof import("./androidView").playerGetDuration;
63
+ playerGetCurrentPosition: typeof import("./androidView").playerGetCurrentPosition;
64
+ playerGetPlayerState: typeof import("./androidView").playerGetPlayerState;
65
+ playerPlayNewFile: typeof import("./androidView").playerPlayNewFile;
66
+ playerSetLooping: typeof import("./androidView").playerSetLooping;
67
+ playerSetAutoWakeLock: typeof import("./androidView").playerSetAutoWakeLock;
68
+ playerRePlay: typeof import("./androidView").playerRePlay;
69
+ playerSetPlayWhenReady: typeof import("./androidView").playerSetPlayWhenReady;
70
+ playerGetPlayerCore: typeof import("./androidView").playerGetPlayerCore;
71
+ playerGetRealPlayerCore: typeof import("./androidView").playerGetRealPlayerCore;
72
+ playerSetListener: typeof import("./androidView").playerSetListener;
73
+ playerDeleteListener: typeof import("./androidView").playerDeleteListener;
74
+ setVideoLayout: typeof import("./androidView").setVideoLayout;
75
+ setVideoVisible: typeof import("./androidView").setVideoVisible;
76
+ setBackground: typeof import("./androidView").setBackground;
77
+ clearBackground: typeof import("./androidView").clearBackground;
78
+ showVoiceTipsBar: typeof import("./androidView").showVoiceTipsBar;
79
+ hideVoiceTipsBar: typeof import("./androidView").hideVoiceTipsBar;
80
+ };
81
+ audio: {
82
+ playNew: typeof import("./audio").playNew;
83
+ stop: typeof import("./audio").stop;
84
+ isPlaying: typeof import("./audio").isPlaying;
85
+ hasPrepared: typeof import("./audio").hasPrepared;
86
+ getDuration: typeof import("./audio").getDuration;
87
+ getCurrentPosition: typeof import("./audio").getCurrentPosition;
88
+ getPlayerState: typeof import("./audio").getPlayerState;
89
+ pause: typeof import("./audio").pause;
90
+ start: typeof import("./audio").start;
91
+ rePlay: typeof import("./audio").rePlay;
92
+ seekTo: typeof import("./audio").seekTo;
93
+ setLooping: typeof import("./audio").setLooping;
94
+ setVolume: typeof import("./audio").setVolume;
95
+ setListener: typeof import("./audio").setListener;
96
+ deleteListener: typeof import("./audio").deleteListener;
97
+ };
98
+ file: {
99
+ readAllContent: typeof import("./file").readAllContent;
100
+ writeAllContent: typeof import("./file").writeAllContent;
101
+ getBaseDir: typeof import("./file").getBaseDir;
102
+ getCacheDir: typeof import("./file").getCacheDir;
103
+ makeCacheFile: typeof import("./file").makeCacheFile;
104
+ makeNormalFile: typeof import("./file").makeNormalFile;
105
+ exists: typeof import("./file").exists;
106
+ isFile: typeof import("./file").isFile;
107
+ isDirectory: typeof import("./file").isDirectory;
108
+ isHidden: typeof import("./file").isHidden;
109
+ canRead: typeof import("./file").canRead;
110
+ canWrite: typeof import("./file").canWrite;
111
+ canExecute: typeof import("./file").canExecute;
112
+ lastModified: typeof import("./file").lastModified;
113
+ deleteIt: typeof import("./file").deleteIt;
114
+ mkdir: typeof import("./file").mkdir;
115
+ mkdirs: typeof import("./file").mkdirs;
116
+ rename: typeof import("./file").rename;
117
+ getAbsolutePath: typeof import("./file").getAbsolutePath;
118
+ createNewFile: typeof import("./file").createNewFile;
119
+ setReadable: typeof import("./file").setReadable;
120
+ setWritable: typeof import("./file").setWritable;
121
+ setExecutable: typeof import("./file").setExecutable;
122
+ setLastModified: typeof import("./file").setLastModified;
123
+ list: typeof import("./file").list;
124
+ };
125
+ isRunInCooPark: typeof isRunInCooPark;
126
+ };
127
+ export default _default;
@@ -0,0 +1,37 @@
1
+ export interface SimpleHttpRequestParam {
2
+ url: string;
3
+ method: string;
4
+ header?: string;
5
+ postType?: string;
6
+ body?: string;
7
+ base64Flag?: boolean;
8
+ }
9
+ export interface SSERequestParam {
10
+ url: string;
11
+ method: string;
12
+ header?: string;
13
+ postType?: string;
14
+ body?: string;
15
+ base64Flag?: boolean;
16
+ }
17
+ export declare function paramToUrl(params: any): string;
18
+ export declare function simpleHttpRequest(params: SimpleHttpRequestParam): Promise<any>;
19
+ export declare function httpGet(url: string, urlParam?: any, header?: object, base64?: boolean): Promise<any>;
20
+ export declare function httpPost(url: string, body?: string | object, header?: object | null, postJson?: boolean, base64?: boolean, postType?: string | null): Promise<any>;
21
+ export declare function httpSseGet(url: string, urlParam?: any, header?: object, base64?: boolean): Promise<any>;
22
+ export declare function getNetworkInfo(): Promise<any>;
23
+ export declare function getDomainName(domain: string): Promise<any>;
24
+ export declare function getCommonHeader(): Promise<any>;
25
+ export declare function readSse(params: SSERequestParam): Promise<any>;
26
+ export declare function downloadToFile(url: string, tempFlag?: boolean, method?: string, header?: string, postType?: string, body?: string): Promise<any>;
27
+ declare const _default: {
28
+ simpleHttpRequest: typeof simpleHttpRequest;
29
+ httpGet: typeof httpGet;
30
+ httpPost: typeof httpPost;
31
+ httpSseGet: typeof httpSseGet;
32
+ getNetworkInfo: typeof getNetworkInfo;
33
+ getDomainName: typeof getDomainName;
34
+ getCommonHeader: typeof getCommonHeader;
35
+ downloadToFile: typeof downloadToFile;
36
+ };
37
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export declare function setKey(key: string, value: string): Promise<any>;
2
+ export declare function getKey(key: string): Promise<any>;
3
+ export declare function deleteKey(key: string): Promise<any>;
4
+ export declare function clearAllKeys(): Promise<any>;
5
+ declare const _default: {
6
+ setKey: typeof setKey;
7
+ getKey: typeof getKey;
8
+ deleteKey: typeof deleteKey;
9
+ clearAllKeys: typeof clearAllKeys;
10
+ };
11
+ export default _default;
@@ -0,0 +1,20 @@
1
+ export interface SystemKeyParam {
2
+ keys: number[];
3
+ }
4
+ export declare function getSdkVersion(): Promise<any>;
5
+ export declare function addLifeCycleHook(callback: Function): Promise<any>;
6
+ export declare function deleteLifeCycleHook(): Promise<any>;
7
+ export declare function enableSystemKey(params: SystemKeyParam | null): Promise<any>;
8
+ export declare function getDeviceInfo(): Promise<any>;
9
+ export declare function getProperty(key: string): Promise<any>;
10
+ export declare function getLocation(): Promise<any>;
11
+ declare const _default: {
12
+ getSdkVersion: typeof getSdkVersion;
13
+ addLifeCycleHook: typeof addLifeCycleHook;
14
+ deleteLifeCycleHook: typeof deleteLifeCycleHook;
15
+ enableSystemKey: typeof enableSystemKey;
16
+ getDeviceInfo: typeof getDeviceInfo;
17
+ getProperty: typeof getProperty;
18
+ getLocation: typeof getLocation;
19
+ };
20
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@ccos/ccsdk-lite",
3
+ "version": "1.0.0",
4
+ "description": "a jssdk for coocaa tv-system",
5
+ "main": "dist/bundle.js",
6
+ "module": "dist/bundle.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "rollup -c"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "http://gitlab.skysri.com/systemWebpage/ccsdk-lite"
18
+ },
19
+ "author": "coocaa",
20
+ "license": "ISC",
21
+ "devDependencies": {
22
+ "@rollup/plugin-typescript": "^12.1.4",
23
+ "rollup": "^4.45.1",
24
+ "typescript": "^5.8.3"
25
+ },
26
+ "dependencies": {
27
+ "tslib": "^2.8.1"
28
+ }
29
+ }