• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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/**
17 * This is a sample class.
18 */
19declare class MyClass {
20  name: string;
21
22  /**
23   * Constructor for MyClass.
24   * @param {string} name - The name parameter.
25   */
26  constructor(name: string);
27
28  /**
29   * A simple function.
30   * @param {number} x - The first number.
31   * @param {number} y - The second number.
32   * @returns {number} The sum of x and y.
33   */
34  add(x: number, y: number): number;
35
36  /**
37   * A method that greets.
38   * @param {string} greeting - The greeting message.
39   */
40  greet(greeting: string): void;
41}
42
43/**
44 * A simple function declaration.
45 * @param {string} message - The message parameter.
46 * @returns {string} The formatted message.
47 */
48declare function formatMessage(message: string): string;
49
50/**
51 * An interface representing a point.
52 * @interface
53 */
54declare interface Point {
55  x: number;
56  y: number;
57}
58
59/**
60 * A type alias for a callback function.
61 * @typedef {function} Callback
62 * @param {string} result - The result parameter.
63 */
64type Callback = (result: string) => void;
65
66/**
67 * An enumeration of colors.
68 * @enum {string}
69 */
70declare enum Color {
71  Red = "RED",
72  Green = "GREEN",
73  Blue = "BLUE",
74}
75