From 35fe3cad4bea91abe1e29d48d5556d6324e49fc6 Mon Sep 17 00:00:00 2001 From: Josh Oppenheim Date: Tue, 12 Mar 2019 13:58:26 -0400 Subject: [PATCH] ReceiveQueueMessageOptions and ReceiveSubscriptionOptions are same (#33672) --- types/azure-sb/index.d.ts | 139 ++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 60 deletions(-) diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index acb0bed06a..cf458d4080 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -4,25 +4,31 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -export import ServiceBusService = require('./lib/servicebusservice'); -export import NotificationHubService = require('./lib/notificationhubservice'); -export import WrapService = require('./lib/wrapservice'); +export import ServiceBusService = require("./lib/servicebusservice"); +export import NotificationHubService = require("./lib/notificationhubservice"); +export import WrapService = require("./lib/wrapservice"); -export function createServiceBusService(namespaceOrConnectionString?: string, - accessKey?: string, - issuer?: string, - acsNamespace?: string, - host?: string, - authenticationProvider?: object): ServiceBusService; +export function createServiceBusService( + namespaceOrConnectionString?: string, + accessKey?: string, + issuer?: string, + acsNamespace?: string, + host?: string, + authenticationProvider?: object +): ServiceBusService; -export function createNotificationHubService(hubName: string, - endpointOrConnectionString?: string, - sharedAccessKeyName?: string, - sharedAccessKeyValue?: string): NotificationHubService; +export function createNotificationHubService( + hubName: string, + endpointOrConnectionString?: string, + sharedAccessKeyName?: string, + sharedAccessKeyValue?: string +): NotificationHubService; -export function createWrapService(acsHost: string, - issuer?: string, - accessKey?: string): WrapService; +export function createWrapService( + acsHost: string, + issuer?: string, + accessKey?: string +): WrapService; export namespace Azure.ServiceBus { export type Duration = string; @@ -33,12 +39,12 @@ export namespace Azure.ServiceBus { } export interface ReceiveQueueMessageOptions { + isPeekLock?: boolean; timeoutIntervalInS?: number; } - export interface ReceiveSubscriptionMessageOptions extends ReceiveQueueMessageOptions { - isPeekLock?: boolean; - } + export interface ReceiveSubscriptionMessageOptions + extends ReceiveQueueMessageOptions {} interface IBrokerPropertiesResponse { readonly DeliveryCount: number; @@ -150,21 +156,21 @@ export namespace Azure.ServiceBus { readonly expiredPushChannel?: string; tags?: Array; templates?: { - [name: string]: { - body: string; - headers?: any; - expiry?: string; - tags?: Array; - }; + [name: string]: { + body: string; + headers?: any; + expiry?: string; + tags?: Array; + }; }; secondaryTile?: { - [titleId: string]: { - pushChannel: string; - tags?: Array; - templates?: any; - }; + [titleId: string]: { + pushChannel: string; + tags?: Array; + templates?: any; + }; }; - } + } export interface Response { body: Dictionary; @@ -185,23 +191,23 @@ export namespace Azure.ServiceBus { export namespace Results.Models { export enum EntityStatus { - Active = 'Active', - Creating = 'Creating', - Deleting = 'Deleting', - Disabled = 'Disabled', - ReceiveDisabled = 'ReceiveDisabled', - Renaming = 'Renaming', - Restoring = 'Restoring', - SendDisabled = 'SendDisabled', - Unknown = 'Unknown' + Active = "Active", + Creating = "Creating", + Deleting = "Deleting", + Disabled = "Disabled", + ReceiveDisabled = "ReceiveDisabled", + Renaming = "Renaming", + Restoring = "Restoring", + SendDisabled = "SendDisabled", + Unknown = "Unknown" } export enum EntityAvailabilityStatus { - Available = 'Available', - Limited = 'Limited', - Renaming = 'Renaming', - Restoring = 'Restoring', - Unknown = 'Unknown' + Available = "Available", + Limited = "Limited", + Renaming = "Renaming", + Restoring = "Restoring", + Unknown = "Unknown" } interface Base { @@ -240,11 +246,12 @@ export namespace Azure.ServiceBus { // [x: string]: string | Dictionary; // } - export const ActiveMessageCount = 'd2p1:ActiveMessageCount'; - export const DeadLetterMessageCount = 'd2p1:DeadLetterMessageCount'; - export const ScheduledMessageCount = 'd2p1:ScheduledMessageCount'; - export const TransferMessageCount = 'd2p1:TransferMessageCount'; - export const TransferDeadLetterMessageCount = 'd2p1:TransferDeadLetterMessageCount'; + export const ActiveMessageCount = "d2p1:ActiveMessageCount"; + export const DeadLetterMessageCount = "d2p1:DeadLetterMessageCount"; + export const ScheduledMessageCount = "d2p1:ScheduledMessageCount"; + export const TransferMessageCount = "d2p1:TransferMessageCount"; + export const TransferDeadLetterMessageCount = + "d2p1:TransferDeadLetterMessageCount"; export interface Topic extends ExtendedBase { AccessedAt: DateString; @@ -314,31 +321,43 @@ export namespace Azure.ServiceBus { /* * Callbacks */ - export type ResponseCallback = (error: Error | null, response: Response) => void; + export type ResponseCallback = ( + error: Error | null, + response: Response + ) => void; - export type ResultAndResponseCallback = (error: Error | null, - result: boolean | Results.Models.Base | Results.Models.Base[], - response: Response) => void; + export type ResultAndResponseCallback = ( + error: Error | null, + result: boolean | Results.Models.Base | Results.Models.Base[], + response: Response + ) => void; - export type TypedResultAndResponseCallback = (error: Error | null, - result: T, - response: Response) => void; + export type TypedResultAndResponseCallback = ( + error: Error | null, + result: T, + response: Response + ) => void; /* * Options interfaces with all properties as optional */ export type BrokerProperties = Partial; - export type BrokerPropertiesResponse = IBrokerPropertiesResponse & Partial; + export type BrokerPropertiesResponse = IBrokerPropertiesResponse & + Partial; export type CreateQueueOptions = Partial; export type CreateTopicOptions = Partial; - export type CreateTopicIfNotExistsOptions = Partial; + export type CreateTopicIfNotExistsOptions = Partial< + ICreateTopicIfNotExistsOptions + >; export type CreateSubscriptionOptions = Partial; export type ListSubscriptionsOptions = Partial; export type ListRulesOptions = Partial; export type ListTopicsOptions = Partial; export type ListQueuesOptions = Partial; export type CreateRuleOptions = Partial; - export type CreateNotificationHubOptions = Partial; + export type CreateNotificationHubOptions = Partial< + ICreateNotificationHubOptions + >; export type ListNotificationHubsOptions = Partial; export type MessageOrName = Message | string;