• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// issue 13043
17declare type Length = string | number | Resource;
18declare interface Resource {
19  readonly id: number;
20  readonly type: number;
21}
22declare type Padding = {
23  top?: Length;
24  right?: Length;
25  bottom?: Length;
26  left?: Length;
27}
28export type Margin = Padding;
29
30// issue 13048
31export interface BusinessError<T = void> extends Error {
32  code: number;
33  data?: T;
34}
35export interface AsyncCallback<T, E = void> {
36  (err: BusinessError<E>, data: T): void;
37}
38export interface AsyncCallback2<T> {
39  (err: { v: number, [v: string]: number }, data: T): void;
40}
41