Add types declarations for the 'http-link-header' module
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 06 Jul 2017 10:09:57 +0200
changeset 253 22f11f2c300d
parent 252 6742e5af0acb
child 254 100978264f6e
Add types declarations for the 'http-link-header' module Types provided by the @types/http-link-header package are outdated. Until its updated, the http-link-header.d.ts file provides the types which will be needed by hypermedia.ts.
src/services/http-link-header.d.ts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/services/http-link-header.d.ts	Thu Jul 06 10:09:57 2017 +0200
@@ -0,0 +1,13 @@
+declare module 'http-link-header' {
+    export interface Reference {
+        uri: string;
+        rel: string;
+        [index: string]: string;
+    }
+
+    export interface Links {
+        rel: (rel: string) => Reference[];
+    }
+
+    export const parse: (linkHeader: string) => Links;
+}