]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/oauth/oauth-client-interface.ts
Move to promises
[github/Chocobozzz/PeerTube.git] / server / models / oauth / oauth-client-interface.ts
index 3b4325740bca26675dd8d3b478dd9e35770fc866..3526e41595932d21a02a708d9f6bca666474e03a 100644 (file)
@@ -1,13 +1,12 @@
 import * as Sequelize from 'sequelize'
+import * as Promise from 'bluebird'
 
 export namespace OAuthClientMethods {
-  export type CountTotalCallback = (err: Error, total: number) => void
-  export type CountTotal = (callback: CountTotalCallback) => void
+  export type CountTotal = () => Promise<number>
 
-  export type LoadFirstClientCallback = (err: Error, client: OAuthClientInstance) => void
-  export type LoadFirstClient = (callback: LoadFirstClientCallback) => void
+  export type LoadFirstClient = () => Promise<OAuthClientInstance>
 
-  export type GetByIdAndSecret = (clientId, clientSecret) => void
+  export type GetByIdAndSecret = (clientId: string, clientSecret: string) => Promise<OAuthClientInstance>
 }
 
 export interface OAuthClientClass {