typescript Aerogear unifiedpush节点发送者打字稿定义
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript Aerogear unifiedpush节点发送者打字稿定义相关的知识,希望对你有一定的参考价值。
declare namespace AeroGear {
export namespace Sender {
export interface Config {
url:string,
applicationId:string,
masterSecret:string,
headers?:Object
}
/**
* Message structure
*/
export interface Message {
/**
* message that will be displayed on the alert UI element
*/
alert:string,
/**
* sets a processing priority on a push message. values can be 'normal' or 'high'
*/
priority?:"normal"|"high",
/**
* The name of a sound file
*/
sound?:string,
/**
* The number to display as the badge of the app icon
*/
badge?:string,
/**
* any extra user data to be passed
*/
userData?:Object,
/**
* Apple Push Notifications Service Section
*/
apns?: {
/**
* A short string describing the purpose of the notification.
*/
title?:string,
/**
* the identifier of the action category for the interactive notification
*/
actionCategory?:string,
/**
*
*/
contentAvailable?:boolean,
/**
* The label of the action button
*/
action?:string,
/**
* an array of values that are paired with the placeholders inside the urlFormatString value of your website.json file. Safari Only
*/
urlArgs?:Array<string>,
/**
* The key to a title string in the Localizable.strings file for the current localization. iOS Only
*/
titleLocKey?:string,
/**
* Variable string values to appear in place of the format specifiers in title-loc-key. iOS Only
*/
titleLocArgs?:Array<string>,
},
/**
* Window Notification Service
*/
windows?: {
/**
* The type of message to send toast, raw, badge or tile.
*/
type?:string,
/**
* Duration a Toast message is displayed 'long' or 'short'
*/
duration?:string,
/**
* Badge notifications type for badges that are not numbers (none, activity, alert, available, away, busy, newMessage, paused, playing, unavailable, error or attention), for numbers use the value in the main part of the message.
*/
badge?:string,
/**
* Different type of tile messages with different sizes see the [tile template catalog]{@link https://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx} e.g. 'TileSquareText02' or 'TileWideBlockAndText02'
*/
tileType?:string,
/**
* Images either local or remote need match the nubmer of the tileType
*/
images?:Array<string>,
/**
* Texts needs to be same as the number of the tileType
*/
textFields?:Array<string>
},
/**
* simplePush version number
*/
simplePush?:string
}
/**
* Options structure
*/
export interface Options {
/**
* the config to select
*/
config?: {
/**
* the time to live in seconds. This value is supported by APNs and GCM Only
*/
ttl?:number; // the time to live in seconds. This value is supported by APNs and GCM Only
},
/**
* the criteria to select
*/
criteria?: {
/**
* a list of email or name strings
*/
alias?:Array<string>,
/**
* a list of device types as strings
*/
deviceType?:Array<string>,
/**
* a list of categories as strings
*/
categories?:Array<string>,
/**
* a list of variantID's as strings
*/
variants?:Array<string>
}
}
export interface Client {
sender: {
send( message:Message, options?:Options );
}
}
export function unifiedPushSenderClient( config:Config ):Promise<Client>;
}
}
declare module 'unifiedpush-node-sender' {
export = AeroGear.Sender.unifiedPushSenderClient;
}
以上是关于typescript Aerogear unifiedpush节点发送者打字稿定义的主要内容,如果未能解决你的问题,请参考以下文章
使用 Pipe (Aerogear) 调用 api 时出现状态码 404 和服务连接错误