diff --git a/types/methods/index.d.ts b/types/methods/index.d.ts index eb59911c82..a445c21110 100644 --- a/types/methods/index.d.ts +++ b/types/methods/index.d.ts @@ -1,7 +1,78 @@ // Type definitions for methods 1.1 // Project: https://github.com/jshttp/methods // Definitions by: Carlos Precioso +// Michel Bitter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare const methods: string[]; +type Method = + | 'ACL' + | 'BIND' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'DELETE' + | 'GET' + | 'HEAD' + | 'LINK' + | 'LOCK' + | 'M-SEARCH' + | 'MERGE' + | 'MKACTIVITY' + | 'MKCALENDAR' + | 'MKCOL' + | 'MOVE' + | 'NOTIFY' + | 'OPTIONS' + | 'PATCH' + | 'POST' + | 'PROPFIND' + | 'PROPPATCH' + | 'PURGE' + | 'PUT' + | 'REBIND' + | 'REPORT' + | 'SEARCH' + | 'SOURCE' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNBIND' + | 'UNLINK' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'acl' + | 'bind' + | 'checkout' + | 'connect' + | 'copy' + | 'delete' + | 'get' + | 'head' + | 'link' + | 'lock' + | 'm-search' + | 'merge' + | 'mkactivity' + | 'mkcalendar' + | 'mkcol' + | 'move' + | 'notify' + | 'options' + | 'patch' + | 'post' + | 'propfind' + | 'proppatch' + | 'purge' + | 'put' + | 'rebind' + | 'report' + | 'search' + | 'source' + | 'subscribe' + | 'trace' + | 'unbind' + | 'unlink' + | 'unlock' + | 'unsubscribe'; + +declare const methods: Method[]; export = methods; diff --git a/types/methods/methods-tests.ts b/types/methods/methods-tests.ts index 69fab6bd2e..48a81ee7eb 100644 --- a/types/methods/methods-tests.ts +++ b/types/methods/methods-tests.ts @@ -1,5 +1,7 @@ -import * as methods from "methods"; +import * as methods from 'methods'; -methods - .slice(0) - .map(method => method.toUpperCase()); +methods.slice(0).map(method => method.toUpperCase()); + +methods.find(item => { + return item === 'get'; +});