From 8b6c5fc20e38c0d925a08e0364896da7634b2174 Mon Sep 17 00:00:00 2001 From: Stephen Lautier Date: Fri, 18 Sep 2015 21:23:42 +0200 Subject: [PATCH] angular-cookies - added options + minor improvements --- angularjs/angular-cookies.d.ts | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index e34518b8a..617b9f793 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -16,6 +16,30 @@ declare module "angular-cookies" { */ declare module angular.cookies { + /** + * Cookies options + * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider#defaults + */ + interface ICookiesOptions { + /** + * The cookie will be available only for this path and its sub-paths. By default, this would be the URL that appears in your base tag. + */ + path?: string; + /** + * The cookie will be available only for this domain and its sub-domains. + * For obvious security reasons the user agent will not accept the cookie if the current domain is not a sub domain or equals to the requested domain. + */ + domain?: string; + /** + * String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object indicating the exact date/time this cookie will expire. + */ + expires?: string|Date; + /** + * The cookie will be available only in secured connection. + */ + secure?: boolean; + } + /** * CookieService * see http://docs.angularjs.org/api/ngCookies.$cookies @@ -31,10 +55,11 @@ declare module angular.cookies { interface ICookiesService { get(key: string): string; getObject(key: string): any; + getObject(key: string): T; getAll(): any; - put(key: string, value: string, options?: any): void; - putObject(key: string, value: any, options?: any): void; - remove(key: string, options?: any): void; + put(key: string, value: string, options?: ICookiesOptions): void; + putObject(key: string, value: any, options?: ICookiesOptions): void; + remove(key: string, options?: ICookiesOptions): void; } /**