Skip to content

Commit

Permalink
Merge pull request #5903 from stephenlautier/angular-cookies
Browse files Browse the repository at this point in the history
angular-cookies - added options + minor improvements
  • Loading branch information
vvakame committed Sep 27, 2015
2 parents 5233ae9 + ccd3278 commit 7a98519
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions angularjs/angular-cookies.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ 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
Expand All @@ -31,10 +58,11 @@ declare module angular.cookies {
interface ICookiesService {
get(key: string): string;
getObject(key: string): any;
getObject<T>(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;
}

/**
Expand Down

0 comments on commit 7a98519

Please sign in to comment.