0.1.2 • Published 2 years ago

@telegram.ts/documentation v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A lightweight TypeScript and JavaScript library for searching the Telegram API documentation.

📖 Installation

To install the library, run the following command:

npm install @telegram.ts/documentation

⭐️ Usage

Here's an example of how to use the library:

import { Search } from '@telegram.ts/documentation';

const search = new Search('https://raw.githubusercontent.com/Sempai-07/Telegramsjs/main/src/BaseClient.d.ts');

(async () => {
  // Get the function declaration
  const functionDeclaration = await search.getFunction('sendPhoto');
  console.log(functionDeclaration);

  // Get the documentation link for the function
  const functionLink = await search.getFunctionLink('sendPhoto');
  console.log(functionLink);

  // Get the documentation link for an object
  const objectLink = await search.getObject('Message');
  console.log(objectLink);
})();

🔥 API

Search

The main class of the library.

🫡 Constructor

  • constructor(fileUrl: string): Creates a new instance of the Search class with the specified file URL.

🎮 Methods

  • getContent(): Promise<string | null>: Retrieves the content of the file from the specified URL.

  • getFunction(functionName: string): Promise<string | null>: Searches for a function in the file by its name and returns the function declaration.

  • getFunctionLink(functionName: string): Promise<string | null>: Returns the documentation link for the specified function.

  • getObject(objectName: string): Promise<string>: Returns the documentation link for the specified object.

📜 License

This library is licensed under the MIT License. See the LICENSE file for more details.

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago