UNPKG

node-socialite

Version:

Socialite is an OAuth2 authentication tool for Node.js

36 lines (35 loc) 1.77 kB
import Crypto from 'crypto'; export declare const merge: (target: any, source: any) => any; export declare const buildQueryString: (data: Record<string, any>, options?: Record<string, any>) => string; export declare const parseQueryString: (data: string, options?: Record<string, any>) => Record<string, any>; export declare const isString: (data: any) => boolean; export declare const isArray: (data: any) => boolean; export declare const isNumber: (data: any) => boolean; export declare const isObject: (data: any) => boolean; export declare const isFunction: (data: any) => boolean; export declare const inArray: (data: any, arr: any, strict?: boolean) => boolean; export declare const strUcwords: (str: string) => string; export declare const strLcwords: (str: string) => string; export declare const strStudly: (value: string) => string; export declare const strCamel: (value: string) => string; /** * 生成哈希 * @param str 原文字符串 * @param type 哈希方式,可选:sha1、md5等待,默认:sha1 * @param target 生成的目标类型,可选:latin1、hex、base64,默认:hex */ export declare const generateHash: (str: Crypto.BinaryLike, type?: string, target?: Crypto.BinaryToTextEncoding) => string; /** * 生成哈希校验码 * @param str 原文字符串 * @param type 加密方式,可选:sha256等待,默认:sha256 * @param target 生成的目标类型,可选:latin1、hex、base64,默认:hex */ export declare const generateHmac: (str: Crypto.BinaryLike, key: string, type?: string, target?: Crypto.BinaryToTextEncoding) => string; /** * 格式化时间 * @param fmt 日期格式 * @param timeStr 时间字符串 * @returns */ export declare const formatTime: (fmt: string, timeStr?: string) => any;