mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Type models
This commit is contained in:
parent
65fcc3119c
commit
e02643f32e
76 changed files with 1710 additions and 816 deletions
32
server/models/request-interface.ts
Normal file
32
server/models/request-interface.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import * as Sequelize from 'sequelize'
|
||||
|
||||
import { PodAttributes } from './pod-interface'
|
||||
|
||||
export namespace RequestMethods {
|
||||
export type CountTotalRequests = (callback) => void
|
||||
export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void
|
||||
export type RemoveWithEmptyTo = (callback) => void
|
||||
export type RemoveAll = (callback) => void
|
||||
}
|
||||
|
||||
export interface RequestClass {
|
||||
countTotalRequests: RequestMethods.CountTotalRequests
|
||||
listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom
|
||||
removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo
|
||||
removeAll: RequestMethods.RemoveAll
|
||||
}
|
||||
|
||||
export interface RequestAttributes {
|
||||
request: object
|
||||
endpoint: string
|
||||
}
|
||||
|
||||
export interface RequestInstance extends Sequelize.Instance<RequestAttributes> {
|
||||
id: number
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
|
||||
setPods: Sequelize.HasManySetAssociationsMixin<PodAttributes, number>
|
||||
}
|
||||
|
||||
export interface RequestModel extends RequestClass, Sequelize.Model<RequestInstance, RequestAttributes> {}
|
Loading…
Add table
Add a link
Reference in a new issue