/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
The definitions of some interfaces implemented in jsapi/workers/worker.cpp are released under Mozilla license.
The definitions and functions of these interfaces are consistent with the standard interfaces under mozila license,
but the implementation of specific functions is independent and self-developed.
All interfaces are described in d.ts, the following is the interface written in d.ts under to Mozilla license
export interface WorkerOptions {
type?: "classic" | "module";
name?: string;
shared?: boolean;
}
export interface Event {
readonly type: string;
readonly timeStamp: number;
}
interface ErrorEvent extends Event {
readonly message: string;
readonly filename: string;
readonly lineno: number;
readonly colno: number;
readonly error: Object;
}
declare interface MessageEvent<T = Object> extends Event {
readonly data: T;
}
export interface PostMessageOptions {
transfer?: Object[];
}
export interface EventListener {
(evt: Event): void | Promise<void>;
}
type MessageType = "message" | "messageerror";
declare interface EventTarget {
addEventListener(
type: string,
listener: EventListener
): void;
dispatchEvent(event: Event): boolean;
removeEventListener(
type: string,
callback?: EventListener
): void;
removeAllListener(): void;
}
declare interface WorkerGlobalScope extends EventTarget {
readonly name: string;
onerror?: (ev: ErrorEvent) => void;
readonly self: WorkerGlobalScope & typeof globalThis;
}
declare interface DedicatedWorkerGlobalScope extends WorkerGlobalScope {
onmessage?: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => void;
onmessageerror?: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => void;
close(): void;
postMessage(messageObject: Object, transfer: Transferable[]): void;
postMessage(messageObject: Object, options?: PostMessageOptions): void;
}
declare namespace worker {
class Worker extends EventTarget {
constructor(scriptURL: string, options?: WorkerOptions);
onexit?: (code: number) => void;
onerror?: (err: ErrorEvent) => void;
onmessage?: (event: MessageEvent) => void;
onmessageerror?: (event: MessageEvent) => void;
postMessage(message: Object, transfer: ArrayBuffer[]): void;
postMessage(message: Object, options?: PostMessageOptions): void;
terminate(): void;
}
const parentPort: DedicatedWorkerGlobalScope;
}
没有合适的资源?快使用搜索试试~ 我知道了~
ets-utils组件用于存放基础类库JSAPI,比如url、uri等
共213个文件
cpp:88个
h:62个
gn:25个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 185 浏览量
2024-01-10
10:41:23
上传
评论
收藏 440KB ZIP 举报
温馨提示
ets_utils组件共提供四个子模块,分别是:js_api_module、js_util_module、js_sys_module和js_concurrent_module,以下内容将详细介绍各个子模块的简介、目录、说明和涉及仓等相关内容。URL接口用于解析,构造,规范化和编码 URLs。 URL的构造函数创建新的URL对象。 以便对URL的已解析组成部分或对URL进行更改。URLSearchParams 接口定义了一些实用的方法来处理 URL 的查询字符串。URI表示统一资源标识符引用。xml表示指可扩展标记语言。XmlSerializer接口用于生成一个xml文件。
资源推荐
资源详情
资源评论
收起资源包目录
ets-utils组件用于存放基础类库JSAPI,比如url、uri等 (213个子文件)
test_xml.cpp 87KB
worker.cpp 84KB
test_napi.cpp 78KB
js_url.cpp 76KB
test_util.cpp 73KB
native_module_util.cpp 70KB
js_xml.cpp 63KB
task_manager.cpp 54KB
native_module_buffer.cpp 39KB
native_module_url.cpp 37KB
test_napi.cpp 35KB
test_napi.cpp 32KB
console.cpp 30KB
test_console.cpp 29KB
native_module_process.cpp 29KB
js_process.cpp 26KB
js_base64.cpp 25KB
js_convertxml.cpp 25KB
test_convertxml.cpp 24KB
test_process.cpp 21KB
test_worker.cpp 21KB
taskpool.cpp 20KB
test_taskpool.cpp 20KB
native_module_xml.cpp 20KB
js_childprocess.cpp 18KB
worker.cpp 18KB
process_helper.cpp 18KB
task.cpp 18KB
js_types.cpp 17KB
js_uri.cpp 17KB
converter.cpp 16KB
test_concurrent.cpp 15KB
native_module_uri.cpp 13KB
js_buffer.cpp 13KB
test_timer.cpp 12KB
timer.cpp 9KB
napi_helper.cpp 9KB
native_module_dfx.cpp 8KB
js_textdecoder.cpp 8KB
js_uuid.cpp 7KB
sequence_runner.cpp 6KB
native_module_convertxml.cpp 5KB
task_group.cpp 4KB
js_textencoder.cpp 3KB
js_blob.cpp 3KB
util_helper.cpp 3KB
message_queue.cpp 2KB
native_module_lightweightmap.cpp 2KB
native_module_lightweightset.cpp 2KB
native_module_plainarray.cpp 2KB
native_module_linkedlist.cpp 2KB
native_module_arraylist.cpp 2KB
native_module_treeset.cpp 2KB
native_module_treemap.cpp 2KB
native_module_hashset.cpp 2KB
native_module_hashmap.cpp 2KB
native_module_struct.cpp 2KB
native_module_vector.cpp 2KB
native_module_deque.cpp 2KB
native_module_stack.cpp 2KB
native_module_queue.cpp 2KB
native_module_list.cpp 2KB
util_helper.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
test_ark.cpp 2KB
task_runner.cpp 1KB
worker_runner.cpp 1KB
process_helper.cpp 1KB
qos_helper.cpp 1KB
native_module_worker.cpp 1KB
thread.cpp 1KB
thread.cpp 1KB
native_module_taskpool.cpp 1KB
jni_helper.cpp 1KB
task_queue.cpp 1KB
qos_helper.cpp 858B
process_helper.cpp 770B
jni_helper.cpp 745B
BUILD.gn 5KB
BUILD.gn 5KB
BUILD.gn 4KB
BUILD.gn 4KB
BUILD.gn 4KB
BUILD.gn 4KB
BUILD.gn 4KB
BUILD.gn 4KB
BUILD.gn 3KB
BUILD.gn 3KB
BUILD.gn 2KB
BUILD.gn 2KB
共 213 条
- 1
- 2
- 3
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6656
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功