@ccos/ccsdk-lite 1.0.15 → 1.0.17
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.
- package/lib/bundle.js +46 -1
- package/lib/file/index.d.ts +10 -0
- package/lib/index.d.ts +5 -0
- package/package.json +1 -1
package/lib/bundle.js
CHANGED
|
@@ -944,6 +944,46 @@ function setLastModified(path, value) {
|
|
|
944
944
|
function list(path) {
|
|
945
945
|
return callNative(getFuncName$3('list'), { path: path });
|
|
946
946
|
}
|
|
947
|
+
// 打开只读文件流
|
|
948
|
+
// 参数:
|
|
949
|
+
// path: 指定文件路径
|
|
950
|
+
// 返回:
|
|
951
|
+
// streamId: 流的ID
|
|
952
|
+
function openInputStream(path) {
|
|
953
|
+
return callNative(getFuncName$3('openInputStream'), { path: path });
|
|
954
|
+
}
|
|
955
|
+
// 打开只写文件流
|
|
956
|
+
// 参数:
|
|
957
|
+
// path: 指定文件路径
|
|
958
|
+
// 返回:
|
|
959
|
+
// streamId: 流的ID
|
|
960
|
+
function openOutputStream(path) {
|
|
961
|
+
return callNative(getFuncName$3('openOutputStream'), { path: path });
|
|
962
|
+
}
|
|
963
|
+
// 关闭文件流(可以是只读流,也可以是只写流)
|
|
964
|
+
// 参数:
|
|
965
|
+
// streamId: 流的ID
|
|
966
|
+
function closeStream(streamId) {
|
|
967
|
+
return callNative(getFuncName$3('closeStream'), { streamId: streamId });
|
|
968
|
+
}
|
|
969
|
+
// 读取文件流的内容
|
|
970
|
+
// 参数:
|
|
971
|
+
// streamId: 流的ID
|
|
972
|
+
// size: 要读取的字节大小
|
|
973
|
+
// base64Flag: 是否以base64的形式返回(默认以普通字符串的形式返回,如果读取二进制文件,则应该设置为以base64的形式返回)
|
|
974
|
+
function readStream(streamId, size, base64Flag) {
|
|
975
|
+
if (base64Flag === void 0) { base64Flag = false; }
|
|
976
|
+
return callNative(getFuncName$3('readStream'), { streamId: streamId, size: size, base64Flag: base64Flag });
|
|
977
|
+
}
|
|
978
|
+
// 将内容写入文件流
|
|
979
|
+
// 参数:
|
|
980
|
+
// streamId: 流的ID
|
|
981
|
+
// content: 要读取的字节大小
|
|
982
|
+
// base64Flag: 是否以base64的形式传递要写入的内容(默认写入普通字符串的文本,如果要写入二进制数据,则应该设置为以base64的形式的内容)
|
|
983
|
+
function writeStream(streamId, content, base64Flag) {
|
|
984
|
+
if (base64Flag === void 0) { base64Flag = false; }
|
|
985
|
+
return callNative(getFuncName$3('writeStream'), { streamId: streamId, content: content, base64Flag: base64Flag });
|
|
986
|
+
}
|
|
947
987
|
var fs = {
|
|
948
988
|
readAllContent: readAllContent,
|
|
949
989
|
writeAllContent: writeAllContent,
|
|
@@ -969,7 +1009,12 @@ var fs = {
|
|
|
969
1009
|
setWritable: setWritable,
|
|
970
1010
|
setExecutable: setExecutable,
|
|
971
1011
|
setLastModified: setLastModified,
|
|
972
|
-
list: list
|
|
1012
|
+
list: list,
|
|
1013
|
+
openInputStream: openInputStream,
|
|
1014
|
+
openOutputStream: openOutputStream,
|
|
1015
|
+
closeStream: closeStream,
|
|
1016
|
+
readStream: readStream,
|
|
1017
|
+
writeStream: writeStream,
|
|
973
1018
|
};
|
|
974
1019
|
|
|
975
1020
|
var moduleName$2 = 'pag';
|
package/lib/file/index.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export declare function setWritable(path: string, value?: boolean): Promise<any>
|
|
|
23
23
|
export declare function setExecutable(path: string, value?: boolean): Promise<any>;
|
|
24
24
|
export declare function setLastModified(path: string, value?: number): Promise<any>;
|
|
25
25
|
export declare function list(path: string): Promise<any>;
|
|
26
|
+
export declare function openInputStream(path: string): Promise<any>;
|
|
27
|
+
export declare function openOutputStream(path: string): Promise<any>;
|
|
28
|
+
export declare function closeStream(streamId: number): Promise<any>;
|
|
29
|
+
export declare function readStream(streamId: number, size: number, base64Flag?: boolean): Promise<any>;
|
|
30
|
+
export declare function writeStream(streamId: number, content: string, base64Flag?: boolean): Promise<any>;
|
|
26
31
|
declare const _default: {
|
|
27
32
|
readAllContent: typeof readAllContent;
|
|
28
33
|
writeAllContent: typeof writeAllContent;
|
|
@@ -49,5 +54,10 @@ declare const _default: {
|
|
|
49
54
|
setExecutable: typeof setExecutable;
|
|
50
55
|
setLastModified: typeof setLastModified;
|
|
51
56
|
list: typeof list;
|
|
57
|
+
openInputStream: typeof openInputStream;
|
|
58
|
+
openOutputStream: typeof openOutputStream;
|
|
59
|
+
closeStream: typeof closeStream;
|
|
60
|
+
readStream: typeof readStream;
|
|
61
|
+
writeStream: typeof writeStream;
|
|
52
62
|
};
|
|
53
63
|
export default _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -132,6 +132,11 @@ declare const _default: {
|
|
|
132
132
|
setExecutable: typeof import("./file").setExecutable;
|
|
133
133
|
setLastModified: typeof import("./file").setLastModified;
|
|
134
134
|
list: typeof import("./file").list;
|
|
135
|
+
openInputStream: typeof import("./file").openInputStream;
|
|
136
|
+
openOutputStream: typeof import("./file").openOutputStream;
|
|
137
|
+
closeStream: typeof import("./file").closeStream;
|
|
138
|
+
readStream: typeof import("./file").readStream;
|
|
139
|
+
writeStream: typeof import("./file").writeStream;
|
|
135
140
|
};
|
|
136
141
|
tts: {
|
|
137
142
|
stopTts: typeof import("./tts").stopTts;
|