@grammyjs/hydrate
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -5,3 +5,3 @@ import { type CallbackQuery, type RawApi } from "../deps.node.js"; | ||
import { type MessageX } from "./message.js"; | ||
interface CallbackQueryXFragment { | ||
export interface CallbackQueryXFragment { | ||
message?: MessageX; | ||
@@ -20,5 +20,4 @@ /** | ||
} | ||
export declare type CallbackQueryX = CallbackQueryXFragment & Partial<InlineMessageXFragment> & CallbackQuery; | ||
export type CallbackQueryX = CallbackQueryXFragment & Partial<InlineMessageXFragment> & CallbackQuery; | ||
export declare function installCallbackQueryMethods(api: RawApi, callbackQuery: CallbackQuery): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
export {}; | ||
import { AbortSignal } from "./../shim.node.js"; |
import { type ChatJoinRequest, type RawApi } from "../deps.node.js"; | ||
import { type Ret } from "../plugin.js"; | ||
interface ChatJoinRequestXFragment { | ||
export interface ChatJoinRequestXFragment { | ||
/** | ||
@@ -21,5 +21,4 @@ * Join chat request-aware alias for `api.approveChatJoinRequest`. Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. | ||
} | ||
export declare type ChatJoinRequestX = ChatJoinRequestXFragment & ChatJoinRequest; | ||
export type ChatJoinRequestX = ChatJoinRequestXFragment & ChatJoinRequest; | ||
export declare function installChatJoinRequestMethods(api: RawApi, chatJoinRequest: ChatJoinRequest): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
export {}; | ||
import { AbortSignal } from "./../shim.node.js"; |
import { type ChosenInlineResult, type RawApi } from "../deps.node.js"; | ||
import { type InlineMessageXFragment } from "./inline-message.js"; | ||
export declare type ChosenInlineResultX = Partial<InlineMessageXFragment> & ChosenInlineResult; | ||
export type ChosenInlineResultX = Partial<InlineMessageXFragment> & ChosenInlineResult; | ||
export declare function installChosenInlineResultMethods(api: RawApi, chosenInlineResult: ChosenInlineResult): void; |
import { type InlineKeyboardMarkup, type InputFile, type InputFileProxy, type RawApi, type SentWebAppMessage } from "../deps.node.js"; | ||
import { Other as O, Ret } from "../plugin.js"; | ||
declare type Other<M extends keyof RawApi, K extends string = never> = O<M, K | "chat_id" | "message_id">; | ||
type Other<M extends keyof RawApi, K extends string = never> = O<M, K | "chat_id" | "message_id">; | ||
export interface InlineMessageXFragment { | ||
@@ -65,5 +65,5 @@ /** | ||
} | ||
export declare type InlineMessageX = InlineMessageXFragment & SentWebAppMessage; | ||
export type InlineMessageX = InlineMessageXFragment & SentWebAppMessage; | ||
export declare function installInlineMessageMethods(api: RawApi, message: SentWebAppMessage): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
import { AbortSignal } from "./../shim.node.js"; | ||
export {}; |
import { type InlineQuery, type InlineQueryResult, type RawApi } from "../deps.node.js"; | ||
import { type Other, type Ret } from "../plugin.js"; | ||
interface InlineQueryXFragment { | ||
export interface InlineQueryXFragment { | ||
/** | ||
@@ -19,5 +19,4 @@ * Inline query-aware alias for `api.answerInlineQuery`. Use this method to send answers to an inline query. On success, True is returned. | ||
} | ||
export declare type InlineQueryX = InlineQueryXFragment & InlineQuery; | ||
export type InlineQueryX = InlineQueryXFragment & InlineQuery; | ||
export declare function installInlineQueryMethods(api: RawApi, inlineQuery: InlineQuery): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
export {}; | ||
import { AbortSignal } from "./../shim.node.js"; |
import { type Message, type RawApi } from "../deps.node.js"; | ||
import { type Other as O, type Ret } from "../plugin.js"; | ||
import { type InlineMessageXFragment } from "./inline-message.js"; | ||
declare type Other<M extends keyof RawApi, K extends string = never> = O<M, K | "chat_id" | "message_id">; | ||
interface MessageXFragment extends InlineMessageXFragment { | ||
type Other<M extends keyof RawApi, K extends string = never> = O<M, K | "chat_id" | "message_id">; | ||
export interface MessageXFragment extends InlineMessageXFragment { | ||
/** | ||
@@ -51,5 +51,5 @@ * Message-aware alias for `api.forwardMessage`. Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned. | ||
} | ||
export declare type MessageX = MessageXFragment & Message; | ||
export type MessageX = MessageXFragment & Message; | ||
export declare function installMessageMethods(api: RawApi, message: Message): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
import { AbortSignal } from "./../shim.node.js"; | ||
export {}; |
import { type PreCheckoutQuery, type RawApi } from "../deps.node.js"; | ||
import { type Other, type Ret } from "../plugin.js"; | ||
interface PreCheckoutQueryXFragment { | ||
export interface PreCheckoutQueryXFragment { | ||
/** | ||
@@ -15,5 +15,4 @@ * Pre-checkout query-aware alias for `api.answerPreCheckoutQuery`. Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. | ||
} | ||
export declare type PreCheckoutQueryX = PreCheckoutQueryXFragment & PreCheckoutQuery; | ||
export type PreCheckoutQueryX = PreCheckoutQueryXFragment & PreCheckoutQuery; | ||
export declare function installPreCheckoutQueryMethods(api: RawApi, preCheckoutQuery: PreCheckoutQuery): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
export {}; | ||
import { AbortSignal } from "./../shim.node.js"; |
import { type RawApi, type ShippingQuery } from "../deps.node.js"; | ||
import { type Other, type Ret } from "../plugin.js"; | ||
interface ShippingQueryXFragment { | ||
export interface ShippingQueryXFragment { | ||
/** | ||
@@ -15,5 +15,4 @@ * Shipping query-aware alias for `api.answerShippingQuery`. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. | ||
} | ||
export declare type ShippingQueryX = ShippingQueryXFragment & ShippingQuery; | ||
export type ShippingQueryX = ShippingQueryXFragment & ShippingQuery; | ||
export declare function installShippingQueryMethods(api: RawApi, shippingQuery: ShippingQuery): void; | ||
import { AbortSignal } from "../shim.node.js"; | ||
export {}; | ||
import { AbortSignal } from "./../shim.node.js"; |
@@ -15,4 +15,4 @@ import { type CallbackQueryX } from "./data/callback-query.js"; | ||
*/ | ||
export declare type HydrateFlavor<C extends Context> = ObjectAssign<C, ContextX<C>>; | ||
export declare type HydrateApiFlavor<A extends Api> = ApiX<A>; | ||
export type HydrateFlavor<C extends Context> = ObjectAssign<C, ContextX<C>>; | ||
export type HydrateApiFlavor<A extends Api> = ApiX<A>; | ||
/** | ||
@@ -66,6 +66,6 @@ * Mapping table from method names to API call result extensions. | ||
export declare function hydrateApi<R extends RawApi = RawApi>(): Transformer<R>; | ||
export declare type Other<M extends keyof RawApi, K extends string = never> = Omit<Opts<M>, K>; | ||
export declare type Opts<M extends keyof RawApi> = InputFileProxy<InputFile>["Opts"][M]; | ||
export declare type Ret<M extends keyof RawApi> = ReturnType<RawApi[M]>; | ||
declare type ObjectAssign<DestType, SourceType> = { | ||
export type Other<M extends keyof RawApi, K extends string = never> = Omit<Opts<M>, K>; | ||
export type Opts<M extends keyof RawApi> = InputFileProxy<InputFile>["Opts"][M]; | ||
export type Ret<M extends keyof RawApi> = ReturnType<RawApi[M]>; | ||
type ObjectAssign<DestType, SourceType> = { | ||
[Key in keyof (DestType & SourceType)]: Key extends keyof SourceType ? SourceType[Key] : Key extends keyof DestType ? DestType[Key] : never; | ||
@@ -109,11 +109,11 @@ }; | ||
} | ||
declare type ApiX<A extends Api> = AddX<A> & { | ||
type ApiX<A extends Api> = AddX<A> & { | ||
raw: RawApiX<A["raw"]>; | ||
}; | ||
declare type RawApiX<R extends RawApi> = AddX<R>; | ||
declare type AddX<Q extends Record<keyof X, (...args: any[]) => any>> = { | ||
type RawApiX<R extends RawApi> = AddX<R>; | ||
type AddX<Q extends Record<keyof X, (...args: any[]) => any>> = { | ||
[K in keyof Q]: K extends keyof X ? Extend<Q[K], X[K]> : Q[K]; | ||
}; | ||
declare type Extend<F extends (...args: any[]) => any, X> = (...args: Parameters<F>) => Promise<Await<ReturnType<F>> & X>; | ||
declare type Await<T> = T extends PromiseLike<infer V> ? Await<V> : T; | ||
type Extend<F extends (...args: any[]) => any, X> = (...args: Parameters<F>) => Promise<Await<ReturnType<F>> & X>; | ||
type Await<T> = T extends PromiseLike<infer V> ? Await<V> : T; | ||
export {}; |
{ | ||
"name": "@grammyjs/hydrate", | ||
"description": "Hydration plugin for grammY", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"author": "KnorpelSenf", | ||
@@ -20,4 +20,4 @@ "license": "MIT", | ||
"build": "deno2node tsconfig.json", | ||
"format": "deno fmt --config deno.json", | ||
"lint": "deno lint --config deno.json" | ||
"format": "deno fmt", | ||
"lint": "deno lint" | ||
}, | ||
@@ -31,5 +31,5 @@ "dependencies": { | ||
"devDependencies": { | ||
"@grammyjs/types": "^2.9.0", | ||
"@grammyjs/types": "^2.10.3", | ||
"@types/node": "^12.20.55", | ||
"deno2node": "1.4.0" | ||
"deno2node": "^1.7.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42090
735