• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 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
17function func1(a: number, b: string) { }
18function func2(a: boolean = true, ...b: number[]) { }
19function func3(a = 6, [c, d], b?) { }
20function func4({ }: number, [a, b]: string[]) { }
21function func5([a, b]: [number, string] = [1, "foo"]) { }
22function func6({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) { }
23declare function func7([a, b]: [number, string])
24declare function func8({ a, b }: { a: number, b: number })
25declare function func9([a, b]?: [number, string])
26declare function func10({ a, b }?: { a: number, b: number })
27
28interface Interface1 {
29    (a: number, { b, c }?: {
30        b?: boolean;
31        c?: any;
32    }): string;
33}