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 * A generic stack class. 18 * @template T - The type of elements in the stack. 19 */ 20declare class Stack<T> { 21 /** 22 * Constructor for Stack. 23 */ 24 constructor(); 25 26 /** 27 * Pushes an element onto the stack. 28 * @param {T} element - The element to push. 29 */ 30 push(element: T): void; 31 32 /** 33 * Pops an element from the stack. 34 * @returns {T} The popped element. 35 */ 36 pop(): T; 37 38 /** 39 * Gets the size of the stack. 40 * @returns {number} The size of the stack. 41 */ 42 size(): number; 43} 44 45/** 46 * An interface representing a geometric shape. 47 * @interface 48 */ 49declare interface GeometricShape { 50 /** 51 * Calculates the area of the shape. 52 * @returns {number} The area of the shape. 53 */ 54 calculateArea(): number; 55} 56 57/** 58 * A function to capitalize the first letter of a string. 59 * @param {string} str - The input string. 60 * @returns {string} The capitalized string. 61 */ 62declare function capitalizeFirstLetter(str: string): string; 63