• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 公共基础库子系统JS API变更
2
3OpenHarmony 3.2 Beta3版本相较于OpenHarmony 3.2 Beta2版本,公共基础库子系统的API变更如下:
4
5## 接口变更
6
7| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
8|---|---|---|---|
9| ohos.buffer | Blob        | text(): Promise\<string>;                                                                                                                                                                                                                                                                                                                                                      | 新增 |
10| ohos.buffer | Blob        | slice(start?: number, end?: number, type?: string): Blob;                                                                                                                                                                                                                                                                                                                      | 新增 |
11| ohos.buffer | Blob        | arrayBuffer(): Promise\<ArrayBuffer>;                                                                                                                                                                                                                                                                                                                                          | 新增 |
12| ohos.buffer | Blob        | type: string;                                                                                                                                                                                                                                                                                                                                                                  | 新增 |
13| ohos.buffer | Blob        | size: number;                                                                                                                                                                                                                                                                                                                                                                  | 新增 |
14| ohos.buffer | Blob        | constructor(sources: string[] \| ArrayBuffer[] \| TypedArray[] \| DataView[] \| Blob[] , options?: Object);                                                                                                                                                                                                                                                                        | 新增 |
15| ohos.buffer | Buffer      | writeUIntLE(value: number, offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                        | 新增 |
16| ohos.buffer | Buffer      | writeUIntBE(value: number, offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                        | 新增 |
17| ohos.buffer | Buffer      | writeUInt32LE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
18| ohos.buffer | Buffer      | writeUInt32BE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
19| ohos.buffer | Buffer      | writeUInt16LE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
20| ohos.buffer | Buffer      | writeUInt16BE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
21| ohos.buffer | Buffer      | writeUInt8(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                            | 新增 |
22| ohos.buffer | Buffer      | writeIntLE(value : number, offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                        | 新增 |
23| ohos.buffer | Buffer      | writeIntBE(value: number, offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                         | 新增 |
24| ohos.buffer | Buffer      | writeInt32LE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
25| ohos.buffer | Buffer      | writeInt32BE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
26| ohos.buffer | Buffer      | writeInt16LE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
27| ohos.buffer | Buffer      | writeInt16BE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
28| ohos.buffer | Buffer      | writeInt8(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                             | 新增 |
29| ohos.buffer | Buffer      | writeFloatLE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
30| ohos.buffer | Buffer      | writeFloatBE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                          | 新增 |
31| ohos.buffer | Buffer      | writeDoubleLE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
32| ohos.buffer | Buffer      | writeDoubleBE(value: number, offset?: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
33| ohos.buffer | Buffer      | writeBigUInt64LE(value: bigint, offset?: number): number;                                                                                                                                                                                                                                                                                                                      | 新增 |
34| ohos.buffer | Buffer      | writeBigUInt64BE(value: bigint, offset?: number): number;                                                                                                                                                                                                                                                                                                                      | 新增 |
35| ohos.buffer | Buffer      | writeBigInt64LE(value: bigint, offset?: number): number;                                                                                                                                                                                                                                                                                                                       | 新增 |
36| ohos.buffer | Buffer      | writeBigInt64BE(value: bigint, offset?: number): number;                                                                                                                                                                                                                                                                                                                       | 新增 |
37| ohos.buffer | Buffer      | write(str: string, offset?: number, length?: number, encoding?: string): number;                                                                                                                                                                                                                                                                                               | 新增 |
38| ohos.buffer | Buffer      | toString(encoding?: string, start?: number, end?: number): string;                                                                                                                                                                                                                                                                                                             | 新增 |
39| ohos.buffer | Buffer      | toJSON(): Object;                                                                                                                                                                                                                                                                                                                                                              | 新增 |
40| ohos.buffer | Buffer      | swap64(): Buffer;                                                                                                                                                                                                                                                                                                                                                              | 新增 |
41| ohos.buffer | Buffer      | swap32(): Buffer;                                                                                                                                                                                                                                                                                                                                                              | 新增 |
42| ohos.buffer | Buffer      | swap16(): Buffer;                                                                                                                                                                                                                                                                                                                                                              | 新增 |
43| ohos.buffer | Buffer      | subarray(start?: number, end?: number): Buffer;                                                                                                                                                                                                                                                                                                                                | 新增 |
44| ohos.buffer | Buffer      | readUIntLE(offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                                        | 新增 |
45| ohos.buffer | Buffer      | readUIntBE(offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                                        | 新增 |
46| ohos.buffer | Buffer      | readUInt32LE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
47| ohos.buffer | Buffer      | readUInt32BE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
48| ohos.buffer | Buffer      | readUInt16LE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
49| ohos.buffer | Buffer      | readUInt16BE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
50| ohos.buffer | Buffer      | readUInt8(offset?: number): number;                                                                                                                                                                                                                                                                                                                                            | 新增 |
51| ohos.buffer | Buffer      | readIntLE(offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
52| ohos.buffer | Buffer      | readIntBE(offset: number, byteLength: number): number;                                                                                                                                                                                                                                                                                                                         | 新增 |
53| ohos.buffer | Buffer      | readInt32LE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
54| ohos.buffer | Buffer      | readInt32BE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
55| ohos.buffer | Buffer      | readInt16LE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
56| ohos.buffer | Buffer      | readInt16BE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
57| ohos.buffer | Buffer      | readInt8(offset?: number): number;                                                                                                                                                                                                                                                                                                                                             | 新增 |
58| ohos.buffer | Buffer      | readFloatLE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
59| ohos.buffer | Buffer      | readFloatBE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                          | 新增 |
60| ohos.buffer | Buffer      | readDoubleLE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
61| ohos.buffer | Buffer      | readDoubleBE(offset?: number): number;                                                                                                                                                                                                                                                                                                                                         | 新增 |
62| ohos.buffer | Buffer      | readBigUInt64LE(offset?: number): bigint;                                                                                                                                                                                                                                                                                                                                      | 新增 |
63| ohos.buffer | Buffer      | readBigUInt64BE(offset?: number): bigint;                                                                                                                                                                                                                                                                                                                                      | 新增 |
64| ohos.buffer | Buffer      | readBigInt64LE(offset?: number): bigint;                                                                                                                                                                                                                                                                                                                                       | 新增 |
65| ohos.buffer | Buffer      | readBigInt64BE(offset?: number): bigint;                                                                                                                                                                                                                                                                                                                                       | 新增 |
66| ohos.buffer | Buffer      | lastIndexOf(value: string \| number \| Buffer \| Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;                                                                                                                                                                                                                                                             | 新增 |
67| ohos.buffer | Buffer      | entries(): IterableIterator\<[number, number]>;                                                                                                                                                                                                                                                                                                                                | 新增 |
68| ohos.buffer | Buffer      | values(): IterableIterator\<number>;                                                                                                                                                                                                                                                                                                                                           | 新增 |
69| ohos.buffer | Buffer      | keys(): IterableIterator\<number>;                                                                                                                                                                                                                                                                                                                                             | 新增 |
70| ohos.buffer | Buffer      | indexOf(value: string \| number \| Buffer \| Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;                                                                                                                                                                                                                                                                 | 新增 |
71| ohos.buffer | Buffer      | includes(value: string \| number \| Buffer \| Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean;                                                                                                                                                                                                                                                               | 新增 |
72| ohos.buffer | Buffer      | equals(otherBuffer: Uint8Array \| Buffer): boolean;                                                                                                                                                                                                                                                                                                                             | 新增 |
73| ohos.buffer | Buffer      | copy(target: Buffer \| Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;                                                                                                                                                                                                                                                                     | 新增 |
74| ohos.buffer | Buffer      | compare(target: Buffer \| Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 \| 0 \| 1;                                                                                                                                                                                                                                          | 新增 |
75| ohos.buffer | Buffer      | fill(value: string \| Buffer \| Uint8Array \| number, offset?: number, end?: number, encoding?: BufferEncoding): Buffer;                                                                                                                                                                                                                                                          | 新增 |
76| ohos.buffer | Buffer      | byteOffset: number;                                                                                                                                                                                                                                                                                                                                                            | 新增 |
77| ohos.buffer | Buffer      | buffer: ArrayBuffer;                                                                                                                                                                                                                                                                                                                                                           | 新增 |
78| ohos.buffer | Buffer      | length: number;                                                                                                                                                                                                                                                                                                                                                                | 新增 |
79| ohos.buffer | buffer      | function transcode(source: Buffer \| Uint8Array, fromEnc: string, toEnc: string): Buffer;                                                                                                                                                                                                                                                                                       | 新增 |
80| ohos.buffer | buffer      | function compare(buf1: Buffer \| Uint8Array, buf2: Buffer \| Uint8Array): -1 \| 0 \| 1;                                                                                                                                                                                                                                                                                            | 新增 |
81| ohos.buffer | buffer      | function isEncoding(encoding: string):boolean;                                                                                                                                                                                                                                                                                                                                 | 新增 |
82| ohos.buffer | buffer      | function isBuffer(obj: Object): boolean;                                                                                                                                                                                                                                                                                                                                       | 新增 |
83| ohos.buffer | buffer      | function from(array: number[]): Buffer;<br>function from(arrayBuffer: ArrayBuffer \| SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;<br>function from(buffer: Buffer \| Uint8Array): Buffer;<br>function from(object: Object, offsetOrEncoding: number \| string, length: number): Buffer;<br>function from(string: String, encoding?: BufferEncoding): Buffer; | 新增 |
84| ohos.buffer | buffer      | function concat(list: Buffer[] \| Uint8Array[], totalLength?: number): Buffer;                                                                                                                                                                                                                                                                                                  | 新增 |
85| ohos.buffer | buffer      | function byteLength(string: string \| Buffer \| TypedArray \| DataView \| ArrayBuffer \| SharedArrayBuffer, encoding?: BufferEncoding): number;                                                                                                                                                                                                                                     | 新增 |
86| ohos.buffer | buffer      | function allocUninitialized(size: number): Buffer;                                                                                                                                                                                                                                                                                                                             | 新增 |
87| ohos.buffer | buffer      | function allocUninitializedFromPool(size: number): Buffer;                                                                                                                                                                                                                                                                                                                     | 新增 |
88| ohos.buffer | buffer      | function alloc(size: number, fill?: string \| Buffer \| number, encoding?: BufferEncoding): Buffer;                                                                                                                                                                                                                                                                              | 新增 |
89| ohos.util   | TextDecoder | decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string;                                                                                                                                                                                                                                                                                                   | 新增 |
90| ohos.util   | util        | function parseUUID(uuid: string): Uint8Array;                                                                                                                                                                                                                                                                                                                                  | 新增 |
91| ohos.util   | util        | function randomBinaryUUID(entropyCache?: boolean): Uint8Array;                                                                                                                                                                                                                                                                                                                 | 新增 |
92| ohos.util   | util        | function randomUUID(entropyCache?: boolean): string;                                                                                                                                                                                                                                                                                                                           | 新增 |
93| ohos.worker | DedicatedWorkerGlobalScope | postMessage(messageObject: Object, transfer: Transferable[]): void;<br>postMessage(messageObject: Object, options?: PostMessageOptions): void;<br>postMessage(messageObject: Object, transfer: ArrayBuffer[]): void; | 废弃 |