Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hylid/types

Package Overview
Dependencies
Maintainers
0
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hylid/types - npm Package Compare versions

Comparing version 3.3.0-alpha.19 to 4.0.0-alpha.0

12

lib/common.d.ts

@@ -16,1 +16,13 @@ export declare type PickAttr<Attr extends keyof T, T = any> = {

export declare type JsApiType = 'async' | 'sync' | 'callback' | 'attribute';
export interface GetGeneralAppInfo {
(): {
walletLogo: string;
walletName: string;
appIcon?: string;
iosDownloadLink: string;
androidDownloadLink: string;
iOSAppId: string;
androidAppId: string;
pspId: string;
};
}

1

lib/custom/index.d.ts
import { AppLinkParams } from './appLink';
export interface HyCustomJSAPI {
getCallAppLink(params: AppLinkParams): string;
getAppScanLink(params: AppLinkParams): string;
}

@@ -25,3 +25,3 @@ /// <reference types="miniprogram" />

}
export interface MPApi extends MiniprogramApi {
export interface MPApi extends Omit<MiniprogramApi, 'request'> {
authorize: (opt: any) => void;

@@ -74,2 +74,16 @@ getAuthUserInfo: (opt: any) => void;

getSDKVersion(args: AsyncCallback<string>): void;
request: (args: {
url: string;
headers?: {
[key: string]: string;
} | undefined;
method?: 'GET' | 'POST' | undefined;
data?: any;
timeout?: number | undefined;
dataType?: 'json' | 'text' | 'base64' | 'arraybuffer' | undefined;
} & AsyncCallback<{
data: any;
status: number;
headers: any;
}>) => void;
createWithoutAuthRpc: (args: {

@@ -80,10 +94,7 @@ appId?: string;

defaultHeaders?: Record<string, string>;
request: (args: RequestArgs) => void;
request: PickMPAttr<'request'>;
}) => PickMPAttr<'rpc'>;
rpcWithAuth: PickMPAttr<'rpc'>;
rpcWithAuthAPlus: PickMPAttr<'rpc'>;
defineRuntimeConfig: {
(args: Record<string, any>): void;
getRuntimeConfig?: () => Record<string, any>;
};
defineRuntimeConfig: (args: Record<string, any>) => Record<string, any>;
getAuthCode: (args: {

@@ -93,7 +104,128 @@ scopes: string | string[];

} & AsyncCallback<GetAuthCodeCallbackValue>) => void;
easyShare: (args: {
bizType: string;
title: string;
desc: string;
searchTips?: string;
iconUrl?: string;
icon?: string;
imageUrl?: string;
image?: string;
url: string;
}) => void;
homeAddAppToMyApps: (args: {
appId: string;
}) => void;
homeCanAddAppToMyApps: (args: {
appId: string;
} & AsyncCallback<{
canAddAppToMyApps: boolean;
}>) => void;
removeNotifyListener: (args: {
name: string;
}) => void;
addNotifyListener: (args: {
name: string;
keep?: boolean;
callback: (res: any) => void;
} & AsyncCallback<void>) => void;
postNotification: (args: {
name: string;
data: object;
}) => void;
openWebURL: (args: {
url: string;
path?: string;
} & AsyncCallback<void>) => void;
openInApp: (args: {
url: string;
path?: string;
} & AsyncCallback<void>) => void;
openOtherApp: (args: {
appId: string;
path?: string;
launchParams?: Record<string, any>;
} & AsyncCallback<void>) => void;
openInBrowser: (args: {
url: string;
path?: string;
} & AsyncCallback<void>) => void;
openPayCodePage: () => void;
openApPayCodePage: () => void;
openScanPage: () => void;
getMainSelectedCity: (args: AsyncCallback<{
fullName: string;
enName: string;
name: string;
code: string;
chineseMainLand: boolean;
isManualSelected: boolean;
settingTime: number;
}>) => void;
chooseDistrict: (args: {
mode?: 0 | 1 | 2;
src?: string;
mainTitle?: string;
mainHeadList?: Array<HeadModel>;
mainNormalList?: Array<ItemModel>;
mainMergeOptions?: Record<string, string>;
seniorTitle?: string;
seniorPageList?: Array<{
title: string;
headList?: Array<HeadModel>;
normalList?: Array<ItemModel>;
}>;
} & AsyncCallback<{
name: string;
adCode: string;
ext: string;
}>) => void;
}
export declare type HeadModel = {
/**
* 区块名,如“热门城市”。
*/
title?: string;
/**
* 模块类型。
* 0: 常规城市。
* 1: 定位模块。
* 2: 展示支付宝提供的热门城市模块。
*/
type?: 0 | 1 | 2;
/**
* 区块城市列表。不支持嵌套。
*/
list?: Array<ItemModel>;
};
export declare type ItemModel = {
/**
* 城市名。
*/
name: string;
/**
* 行政区划代码。不同行政区域对应的代码可查看 https://www.mca.gov.cn/mzsj/xzqh/1980/2019/202002281436.html
*/
adCode: string;
/**
* 城市名对应拼音拼写,方便用户检索。
*/
spell?: string;
/**
* 子标题。
*/
appendName?: string;
/**
* 额外信息。
*/
ext?: string;
/**
* 支持级联,自定义次级城市列表。
*/
subList?: Array<ItemModel>;
};
export declare type PickMPAttr<Attr extends keyof MPApi> = PickAttr<Attr, MPApi>;
export declare type PickMPArgs<Attr extends keyof MPApi> = Parameters<PickMPAttr<Attr>>[0];
export declare type PickMpReturns<Attr extends keyof MPApi> = ReturnType<PickMPAttr<Attr>>;
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?: Omit<T, "success" | "fail" | "complete"> | undefined) => Promise<S> : never;
export declare type ReturnTypePromise<T> = T extends AsyncCallback<infer S> ? (args?: Omit<T, 'success' | 'fail' | 'complete'> | undefined) => Promise<S> : never;
export declare type PickPromiseAttr<T> = T extends (args: infer S) => void ? ReturnTypePromise<S> : never;

2

package.json
{
"name": "@hylid/types",
"version": "3.3.0-alpha.19",
"version": "4.0.0-alpha.0",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc