mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Added azure-sb and improved azure-mobile-apps
This commit is contained in:
@@ -1,47 +1,87 @@
|
||||
/// <reference path="azure-mobile-apps.d.ts" />
|
||||
|
||||
var app = require('express')(),
|
||||
mobileApp = require('azure-mobile-apps')({
|
||||
debug: true,
|
||||
data: {
|
||||
provider: 'mssql',
|
||||
server: '',
|
||||
user: '',
|
||||
database: '',
|
||||
password: ''
|
||||
}
|
||||
})
|
||||
|
||||
mobileApp.tables.add('todoitem', {
|
||||
authorize: true
|
||||
});
|
||||
|
||||
mobileApp.api.add('customApi', {
|
||||
authorize: true,
|
||||
post: function (req: any, res: any, next: any) {
|
||||
next();
|
||||
},
|
||||
patch: [function (req: any, res: any, next: any) {}, function (req: any, res: any, next: any) {}]
|
||||
})
|
||||
|
||||
mobileApp.use(function (req: any, res: any, next: any) {
|
||||
next();
|
||||
});
|
||||
|
||||
var table = mobileApp.table()
|
||||
table.read(function (context: AzureMobileApps.Context) {
|
||||
return context.execute().then(function (result: any) {
|
||||
return result;
|
||||
});
|
||||
});
|
||||
|
||||
table.use(function (req: any, res: any, next: any) {
|
||||
next(new Error());
|
||||
});
|
||||
|
||||
var logger = require('azure-mobile-apps/src/logger');
|
||||
logger.silly('test', 'message');
|
||||
logger.error('Something happened', new Error());
|
||||
|
||||
var queries = require('azure-mobile-apps/src/query');
|
||||
queries.create('table').where({ x: 10 }).select('col1,col2');
|
||||
/// <reference path="azure-mobile-apps.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import mobileApps = require('azure-mobile-apps');
|
||||
import logger = require('azure-mobile-apps/src/logger');
|
||||
import queries = require('azure-mobile-apps/src/query');
|
||||
|
||||
var app = express(),
|
||||
mobileApp = mobileApps();
|
||||
|
||||
// various configuration permutations
|
||||
mobileApps({
|
||||
debug: true,
|
||||
data: {
|
||||
provider: 'mssql',
|
||||
server: '',
|
||||
user: '',
|
||||
database: '',
|
||||
password: ''
|
||||
}
|
||||
});
|
||||
|
||||
mobileApps({
|
||||
data: {
|
||||
provider: 'memory'
|
||||
}
|
||||
})
|
||||
|
||||
// it would be nice to integrate with winston
|
||||
mobileApps({ logging: { level: 'silly', transports: [{}] } })
|
||||
|
||||
// various custom middleware syntaxes
|
||||
mobileApp.use(function (req: any, res: any, next: any) { next(); });
|
||||
mobileApp.use([function () {}, function () {}]);
|
||||
mobileApp.use(function () {}, function () {});
|
||||
mobileApp.use(function () {}).use(function () {});
|
||||
|
||||
// basic syntax for tables and api
|
||||
mobileApp.tables.add('todoitem');
|
||||
mobileApp.tables.add('todoitem', { authorize: true });
|
||||
mobileApp.tables.add('todoitem', mobileApps.table());
|
||||
mobileApp.tables.import('tables');
|
||||
mobileApp.api.add('api', { authorize: true, get: function () {}, delete: function () {} });
|
||||
mobileApp.api.import('api');
|
||||
|
||||
// Express.Table, instantiated from the mobile app
|
||||
var table = mobileApp.table()
|
||||
table.use(function (req: Express.Request, res: Express.Response, next: any) {
|
||||
next(new Error());
|
||||
});
|
||||
table.use([function () {}, function () {}]);
|
||||
table.read(function (context: Azure.MobileApps.Context) {
|
||||
context.query.where({ p1: 'test' });
|
||||
return context.execute()
|
||||
.then(function (result: any) {
|
||||
return result;
|
||||
})
|
||||
.catch(function (error: any) { })
|
||||
.then(function () {});
|
||||
});
|
||||
table.insert(function (context: Azure.MobileApps.Context) {
|
||||
context.query.id = 'anotherId';
|
||||
context.query.single = true;
|
||||
context.item.userId = context.user.id;
|
||||
context.push.send('tag', {}, function (error, result) {});
|
||||
context.push.gcm.send('tag', {}, function (error, result) {});
|
||||
context.push.apns.send('tag', { payload: { } }, function (error, result) {});
|
||||
context.push.wns.sendToastText01('tag', '', { headers: { } }, function (error, result) {});
|
||||
});
|
||||
table.read.use(function () {});
|
||||
table.read.use([function () {}, function () {}]);
|
||||
table.read.use(function () {}, function () {});
|
||||
table.use(function () {}).use(function () {}).read(function () {}).use(function () {})
|
||||
|
||||
// Express.Table, instantiated from the static require('azure-mobile-apps').table()
|
||||
// This is going to be interesting if we ever support more than one provider
|
||||
var table2 = mobileApps.table();
|
||||
table2.read(function (context: Azure.MobileApps.Context) {})
|
||||
|
||||
// Logger
|
||||
logger.silly('test', 'message');
|
||||
logger.error('Something happened', new Error());
|
||||
mobileApps.logger.debug('a debug message')
|
||||
|
||||
// Query
|
||||
queries.create('table').where({ x: 10 }).select('col1,col2');
|
||||
mobileApps.query.create('table');
|
||||
+135
-140
@@ -4,112 +4,95 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
/// <reference path="../azure-sb/azure-sb.d.ts" />
|
||||
|
||||
declare module "azure-mobile-apps" {
|
||||
function returnedFunction(configuration?: AzureMobileApps.Configuration): AzureMobileApps.ExpressMobileApp;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
interface AzureMobileApps {
|
||||
(configuration?: Azure.MobileApps.Configuration): Azure.MobileApps.Platforms.Express.MobileApp;
|
||||
table(): Azure.MobileApps.Platforms.Express.Table;
|
||||
logger: Azure.MobileApps.Logger;
|
||||
query: Azure.MobileApps.Query;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/express" {
|
||||
function returnedFunction(configuration: AzureMobileApps.Configuration): AzureMobileApps.ExpressMobileApp;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
var out: AzureMobileApps;
|
||||
export = out;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/express/api" {
|
||||
function returnedFunction(configuration: AzureMobileApps.Configuration): AzureMobileApps.ExpressApi;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/express/table" {
|
||||
function returnedFunction(definition: AzureMobileApps.TableDefinition): AzureMobileApps.ExpressTable;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/express/tables" {
|
||||
function returnedFunction(configuration: AzureMobileApps.Configuration): AzureMobileApps.ExpressTables;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/auth" {
|
||||
function returnedFunction(configuration: AzureMobileApps.Configuration): AzureMobileApps.Auth;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/data" {
|
||||
function returnedFunction(configuration: AzureMobileApps.Configuration): (table: AzureMobileApps.ExpressTable) => AzureMobileApps.Data;
|
||||
module returnedFunction { }
|
||||
export = returnedFunction;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/logger" {
|
||||
var logger: AzureMobileApps.Logger;
|
||||
var logger: Azure.MobileApps.Logger;
|
||||
export = logger;
|
||||
}
|
||||
|
||||
declare module "azure-mobile-apps/src/query" {
|
||||
var query: AzureMobileApps.Query;
|
||||
var query: Azure.MobileApps.Query;
|
||||
export = query;
|
||||
}
|
||||
|
||||
declare module AzureMobileApps {
|
||||
// express
|
||||
interface ExpressMobileApp {
|
||||
configuration: Configuration;
|
||||
tables: ExpressTables;
|
||||
table(): ExpressTable;
|
||||
api: ExpressApi;
|
||||
use(middleware: Middleware | Middleware[]): void;
|
||||
declare module Azure.MobileApps {
|
||||
// the additional Platforms namespace is required to avoid collisions with the main Express namespace
|
||||
export module Platforms {
|
||||
export module Express {
|
||||
interface MobileApp {
|
||||
configuration: Configuration;
|
||||
tables: Tables;
|
||||
table(): Table;
|
||||
api: Api;
|
||||
use(...middleware: Middleware[]): MobileApp;
|
||||
use(middleware: Middleware[]): MobileApp;
|
||||
}
|
||||
|
||||
interface Api {
|
||||
add(name: string, definition: ApiDefinition): void;
|
||||
import(fileOrFolder: string): void;
|
||||
}
|
||||
|
||||
interface Table {
|
||||
authorize?: boolean;
|
||||
autoIncrement?: boolean;
|
||||
dynamicSchema?: boolean;
|
||||
name: string;
|
||||
columns?: any;
|
||||
schema: string;
|
||||
|
||||
use(...middleware: Middleware[]): Table;
|
||||
use(middleware: Middleware[]): Table;
|
||||
read: TableOperation;
|
||||
update: TableOperation;
|
||||
insert: TableOperation;
|
||||
delete: TableOperation;
|
||||
undelete: TableOperation;
|
||||
}
|
||||
|
||||
interface TableOperation {
|
||||
(operationHandler: (context: Context) => void): Table;
|
||||
use(...middleware: Middleware[]): Table;
|
||||
use(middleware: Middleware[]): Table;
|
||||
}
|
||||
|
||||
interface Tables {
|
||||
configuration: Configuration;
|
||||
add(name: string, definition?: Table | TableDefinition): void;
|
||||
import(fileOrFolder: string): void;
|
||||
initialize(): Thenable<any>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ExpressApi {
|
||||
add(name: string, definition: ApiDefinition): void;
|
||||
import(fileOrFolder: string): void;
|
||||
}
|
||||
export module Data {
|
||||
interface Table {
|
||||
read(query: QueryJs): Thenable<any[]>;
|
||||
update(item: any, query: QueryJs): Thenable<any>;
|
||||
insert(item: any): Thenable<any>;
|
||||
delete(query: QueryJs, version: string): Thenable<any>;
|
||||
undelete(query: QueryJs, version: string): Thenable<any>;
|
||||
truncate(): Thenable<void>;
|
||||
initialize(): Thenable<void>;
|
||||
schema(): Thenable<Column[]>;
|
||||
}
|
||||
|
||||
interface ExpressTable {
|
||||
authorize?: boolean;
|
||||
autoIncrement?: boolean;
|
||||
dynamicSchema?: boolean;
|
||||
name: string;
|
||||
columns?: any;
|
||||
schema: string;
|
||||
|
||||
use(middleware: Middleware | Middleware[]): void;
|
||||
read(operationHandler: (context: Context) => void): void;
|
||||
update(operationHandler: (context: Context) => void): void;
|
||||
insert(operationHandler: (context: Context) => void): void;
|
||||
delete(operationHandler: (context: Context) => void): void;
|
||||
undelete(operationHandler: (context: Context) => void): void;
|
||||
}
|
||||
|
||||
interface ExpressTables {
|
||||
configuration: Configuration;
|
||||
add(name: string, definition: ExpressTable | TableDefinition): void;
|
||||
import(fileOrFolder: string): void;
|
||||
initialize(): Thenable<any>;
|
||||
}
|
||||
|
||||
// data
|
||||
interface Data {
|
||||
read(query: QueryJs): Thenable<any[]>;
|
||||
update(item: any, query: QueryJs): Thenable<any>;
|
||||
insert(item: any): Thenable<any>;
|
||||
delete(query: QueryJs, version: string): Thenable<any>;
|
||||
undelete(query: QueryJs, version: string): Thenable<any>;
|
||||
truncate(): Thenable<void>;
|
||||
initialize(): Thenable<void>;
|
||||
schema(): Thenable<SchemaResult[]>;
|
||||
}
|
||||
|
||||
interface SchemaResult {
|
||||
name: string;
|
||||
type: string;
|
||||
interface Column {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
}
|
||||
|
||||
// auth
|
||||
@@ -144,53 +127,53 @@ declare module AzureMobileApps {
|
||||
swagger?: boolean;
|
||||
maxTop?: number;
|
||||
pageSize?: number;
|
||||
logging?: LoggingConfiguration;
|
||||
data?: MssqlDataConfiguration;
|
||||
auth?: AuthConfiguration;
|
||||
cors?: CorsConfiguration;
|
||||
notifications?: NotificationsConfiguration;
|
||||
logging?: Configuration.Logging;
|
||||
data?: Configuration.Data;
|
||||
auth?: Configuration.Auth;
|
||||
cors?: Configuration.Cors;
|
||||
notifications?: Configuration.Notifications;
|
||||
}
|
||||
|
||||
export module Configuration {
|
||||
// it would be nice to have the config for various providers in separate interfaces,
|
||||
// but this is the simplest solution to support variations of the current setup
|
||||
interface Data {
|
||||
provider: string;
|
||||
user?: string;
|
||||
password?: string;
|
||||
server?: string;
|
||||
port?: number;
|
||||
database?: string;
|
||||
connectionTimeout?: string;
|
||||
options?: { encrypt: boolean };
|
||||
schema?: string;
|
||||
dynamicSchema?: boolean;
|
||||
}
|
||||
|
||||
interface DataConfiguration {
|
||||
provider?: string;
|
||||
}
|
||||
interface Auth {
|
||||
secret: string;
|
||||
validateTokens?: boolean;
|
||||
}
|
||||
|
||||
interface MssqlDataConfiguration {
|
||||
provider: string;
|
||||
user: string;
|
||||
password: string;
|
||||
server: string;
|
||||
port?: number;
|
||||
database: string;
|
||||
connectionTimeout?: string;
|
||||
options?: { encrypt: boolean };
|
||||
schema?: string;
|
||||
dynamicSchema?: boolean;
|
||||
}
|
||||
interface Logging {
|
||||
level?: string;
|
||||
transports?: LoggingTransport[];
|
||||
}
|
||||
|
||||
interface AuthConfiguration {
|
||||
secret: string;
|
||||
validateTokens?: boolean;
|
||||
}
|
||||
interface LoggingTransport { }
|
||||
|
||||
interface LoggingConfiguration {
|
||||
level?: string;
|
||||
transports?: LoggingTransport[];
|
||||
}
|
||||
interface Cors {
|
||||
maxAge?: number;
|
||||
origins: string[];
|
||||
}
|
||||
|
||||
interface LoggingTransport { }
|
||||
|
||||
interface CorsConfiguration {
|
||||
maxAge?: number;
|
||||
origins: string[];
|
||||
}
|
||||
|
||||
interface NotificationsConfiguration {
|
||||
hubName: string;
|
||||
connectionString?: string;
|
||||
endpoint?: string;
|
||||
sharedAccessKeyName?: string;
|
||||
sharedAccessKeyValue?: string;
|
||||
interface Notifications {
|
||||
hubName: string;
|
||||
connectionString?: string;
|
||||
endpoint?: string;
|
||||
sharedAccessKeyName?: string;
|
||||
sharedAccessKeyValue?: string;
|
||||
}
|
||||
}
|
||||
|
||||
// query
|
||||
@@ -208,6 +191,9 @@ declare module AzureMobileApps {
|
||||
skip(count: number): QueryJs;
|
||||
take(count: number): QueryJs;
|
||||
where(filter: any): QueryJs;
|
||||
// these are properties added by the SDK
|
||||
id?: string | number;
|
||||
single?: boolean;
|
||||
}
|
||||
|
||||
interface OData {
|
||||
@@ -221,22 +207,18 @@ declare module AzureMobileApps {
|
||||
includeTotalCount?: boolean;
|
||||
}
|
||||
|
||||
// notifications
|
||||
interface NotificationHubService {
|
||||
|
||||
}
|
||||
|
||||
// general
|
||||
var nh: Azure.ServiceBus.NotificationHubService;
|
||||
interface Context {
|
||||
query: QueryJs;
|
||||
id: string | number;
|
||||
item: any;
|
||||
req: Express.Request;
|
||||
res: Express.Response;
|
||||
data: (table: TableDefinition) => Data;
|
||||
tables: (tableName: string) => Data;
|
||||
data: (table: TableDefinition) => Data.Table;
|
||||
tables: (tableName: string) => Data.Table;
|
||||
user: User;
|
||||
push: NotificationHubService;
|
||||
push: typeof nh;
|
||||
logger: Logger;
|
||||
execute(): Thenable<any>;
|
||||
}
|
||||
@@ -262,6 +244,8 @@ declare module AzureMobileApps {
|
||||
interface Thenable<R> {
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
|
||||
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
catch<U>(onRejected?: (error: any) => void): Thenable<U>;
|
||||
}
|
||||
|
||||
interface Logger {
|
||||
@@ -281,4 +265,15 @@ declare module AzureMobileApps {
|
||||
interface NextMiddleware {
|
||||
(error?: any): void;
|
||||
}
|
||||
}
|
||||
|
||||
// additions to the Express modules
|
||||
declare module Express {
|
||||
interface Request {
|
||||
azureMobile: Azure.MobileApps.Context
|
||||
}
|
||||
|
||||
interface Response {
|
||||
results?: any;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/// <reference path="./azure-sb.d.ts" />
|
||||
|
||||
var nh = new Azure.ServiceBus.NotificationHubService();
|
||||
nh.send('tag', '<payload></payload>', function (error, result) {});
|
||||
nh.send('tag', '<payload></payload>', { headers: {} }, function (error, result) {});
|
||||
|
||||
nh.apns.send('tag', { payload: { } }, function (error, result) {});
|
||||
nh.apns.send(['tag'], { payload: { } }, function (error, result) {});
|
||||
nh.gcm.send('tag', { }, function (error, result) {});
|
||||
nh.gcm.send(['tag'], { }, function (error, result) {});
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', function (error, result) {});
|
||||
nh.wns.send(['tag'], '<payload></payload>', 'wns/toast', function (error, result) {});
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', { headers: {} }, function (error, result) {});
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', function (error, result) {});
|
||||
nh.wns.sendToastText01(['tag'], '<payload></payload>', function (error, result) {});
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', { headers: {} }, function (error, result) {});
|
||||
Vendored
+168
@@ -0,0 +1,168 @@
|
||||
declare module Azure.ServiceBus {
|
||||
interface Callback {
|
||||
(error: any, response: any): void;
|
||||
}
|
||||
|
||||
interface NotificationHubRegistration {
|
||||
RegistrationId: string;
|
||||
ChannelUri?: string;
|
||||
DeviceToken?: string;
|
||||
gcmRegistrationId?: string;
|
||||
Tags?: string;
|
||||
BodyTemplate?: any;
|
||||
WnsHeaders?: any;
|
||||
MpnsHeaders?: any;
|
||||
Expiry?: Date;
|
||||
}
|
||||
|
||||
export class NotificationHubService {
|
||||
new(hubName: string, endpointOrConnectionString: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string): NotificationHubService;
|
||||
hubName: string;
|
||||
wns: Wns.Service;
|
||||
apns: Apns.Service;
|
||||
gcm: Gcm.Service;
|
||||
mpns: Mpns.Service;
|
||||
send(tags: string, payload: Object | string, optionsOrCallback?: { headers: Object } | Callback, callback?: Callback): void;
|
||||
|
||||
createOrUpdateInstallation(installation: string, options: any, callback?: Callback): void;
|
||||
patchInstallation(installationId: string, partialUpdateOperations: any[], options: any, callback?: Callback): void;
|
||||
deleteInstallation(installationId: string, options: any, callback?: Callback): void;
|
||||
getInstallation(installationId: string, options: any, callback?: Callback): void;
|
||||
|
||||
/*
|
||||
// old school?
|
||||
createRegistrationId(callback?: Callback): void;
|
||||
getRegistration(registrationId: string, options: any, callback?: Callback): void;
|
||||
deleteRegistration(registrationId: string, options?: { etag: any }, callback?: Callback): void;
|
||||
updateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void;
|
||||
createOrUpdateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void;
|
||||
listRegistrations(options?: { top: number, skip: number }, callback?: Callback): void;
|
||||
listRegistrationsByTag(tag: string, options?: { top: number, skip: number }, callback?: Callback): void;
|
||||
*/
|
||||
}
|
||||
|
||||
export module Apns {
|
||||
interface Payload {
|
||||
expiry?: Date;
|
||||
aps?: Object;
|
||||
badge?: number;
|
||||
alert?: string;
|
||||
sound?: string;
|
||||
payload: Object;
|
||||
}
|
||||
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
send(tags: string | string[], payload: Apns.Payload, callback?: Callback): void;
|
||||
createNativeRegistration(token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createTemplateRegistration(token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
updateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
listRegistrationsByToken(token: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
}
|
||||
}
|
||||
export module Gcm {
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
send(tags: string | string[], payload: any, callback?: Callback): void;
|
||||
createNativeRegistration(gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createTemplateRegistration(gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
updateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
}
|
||||
}
|
||||
|
||||
export module Mpns { interface Service { } }
|
||||
|
||||
export module Wns {
|
||||
interface Payload {
|
||||
text1?: string;
|
||||
text2?: string;
|
||||
text3?: string;
|
||||
text4?: string;
|
||||
image1src?: string;
|
||||
image1alt?: string;
|
||||
image2src?: string;
|
||||
image2alt?: string;
|
||||
image3src?: string;
|
||||
image3alt?: string;
|
||||
image4src?: string;
|
||||
image4alt?: string;
|
||||
lang?: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
headers: Object;
|
||||
}
|
||||
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
sendTileSquareBlock(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText07(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText08(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText09(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText10(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText11(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageCollection(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideBlockAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideBlockAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
// badges = ['none','activity','alert','available','away','busy','newMessage','paused','playing','unavailable','error', 'attention']
|
||||
sendBadge(tags: string | string[], value: string | number, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendRaw(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
// types = ['wns/toast', 'wns/badge', 'wns/tile', 'wns/raw']
|
||||
send(tags: string | string[], payload: string, type: string, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
createNativeRegistration(channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
listRegistrationsByChannel(channel: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user