@xtsea/tgcore-ts 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,9 +34,11 @@ npm install @xtsea/tgcore-ts
34
34
  ## Getting started
35
35
 
36
36
  ```ts
37
- import { Client } from "@xtsea/tgcore-ts"
37
+ import { tgcore } from "@xtsea/tgcore-ts"
38
38
 
39
- const tg = new Client({ api_key: "fw_live_xxx" })
39
+ // old version: 0.1.9 new Client({})
40
+
41
+ const tg = tgcore({ api_key: "fw_live_xxx" }) // version: 0.1.10
40
42
 
41
43
  await tg.raw.sendMessage({
42
44
  chat_id: -1001234567890,
package/dist/index.cjs CHANGED
@@ -21,7 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Client: () => Client,
24
- KeyboardBuilder: () => KeyboardBuilder
24
+ KeyboardBuilder: () => KeyboardBuilder,
25
+ tgcore: () => tgcore
25
26
  });
26
27
  module.exports = __toCommonJS(index_exports);
27
28
 
@@ -134,6 +135,9 @@ var CallMethods = class {
134
135
  };
135
136
 
136
137
  // src/client.ts
138
+ function tgcore(options) {
139
+ return new Client(options);
140
+ }
137
141
  var Client = class {
138
142
  constructor(opts) {
139
143
  if (!opts?.api_key) {
@@ -234,5 +238,6 @@ var KeyboardBuilder = class _KeyboardBuilder {
234
238
  // Annotate the CommonJS export names for ESM import in node:
235
239
  0 && (module.exports = {
236
240
  Client,
237
- KeyboardBuilder
241
+ KeyboardBuilder,
242
+ tgcore
238
243
  });
package/dist/index.d.cts CHANGED
@@ -53,6 +53,7 @@ type ClientOptions = {
53
53
  base_url?: string;
54
54
  timeout_ms?: number;
55
55
  };
56
+ declare function tgcore(options: ClientOptions): Client;
56
57
  declare class Client {
57
58
  private http;
58
59
  raw: RawMethods;
@@ -110,4 +111,4 @@ declare class KeyboardBuilder {
110
111
  build(): InlineKeyboardMarkup;
111
112
  }
112
113
 
113
- export { Client, type ClientOptions, type InlineKeyboardButton, type InlineKeyboardMarkup, KeyboardBuilder };
114
+ export { Client, type ClientOptions, type InlineKeyboardButton, type InlineKeyboardMarkup, KeyboardBuilder, tgcore };
package/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ type ClientOptions = {
53
53
  base_url?: string;
54
54
  timeout_ms?: number;
55
55
  };
56
+ declare function tgcore(options: ClientOptions): Client;
56
57
  declare class Client {
57
58
  private http;
58
59
  raw: RawMethods;
@@ -110,4 +111,4 @@ declare class KeyboardBuilder {
110
111
  build(): InlineKeyboardMarkup;
111
112
  }
112
113
 
113
- export { Client, type ClientOptions, type InlineKeyboardButton, type InlineKeyboardMarkup, KeyboardBuilder };
114
+ export { Client, type ClientOptions, type InlineKeyboardButton, type InlineKeyboardMarkup, KeyboardBuilder, tgcore };
package/dist/index.js CHANGED
@@ -107,6 +107,9 @@ var CallMethods = class {
107
107
  };
108
108
 
109
109
  // src/client.ts
110
+ function tgcore(options) {
111
+ return new Client(options);
112
+ }
110
113
  var Client = class {
111
114
  constructor(opts) {
112
115
  if (!opts?.api_key) {
@@ -206,5 +209,6 @@ var KeyboardBuilder = class _KeyboardBuilder {
206
209
  };
207
210
  export {
208
211
  Client,
209
- KeyboardBuilder
212
+ KeyboardBuilder,
213
+ tgcore
210
214
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtsea/tgcore-ts",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "tgcore TypeScript SDK • Telegram Engine Client",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",