From c4e09994449f8a6e42aabc50a32ea2adda84dedc Mon Sep 17 00:00:00 2001 From: Arylo Date: Thu, 5 Apr 2018 00:22:02 +0800 Subject: [PATCH] Update type definition files --- types/gitlab/ApiBase.d.ts | 19 +++++++++++++------ types/gitlab/Models/ProjectHooks.d.ts | 6 ++++-- types/gitlab/Models/ProjectRepository.d.ts | 14 +++++++++++--- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts index 9d525be7a4..d57795c141 100644 --- a/types/gitlab/ApiBase.d.ts +++ b/types/gitlab/ApiBase.d.ts @@ -1,3 +1,4 @@ +import { IApiBase } from './ApiBase.d'; import { Labels } from './Models/Labels.d'; import { Users } from './Models/Users.d'; import { Notes } from './Models/Notes.d'; @@ -8,17 +9,23 @@ import { Groups } from './Models/Groups.d'; export interface IApiBase { url?: string; token?: string; + oauth_token?: string; + base_url?: string; + auth?: any; [key: string]: any; } export class ApiBase { constructor(options: IApiBase); - public groups: Groups - public projects: Projects - public issues: Issues - public notes: Notes - public users: Users - public labels: Labels + public readonly client: this; + public readonly groups: Groups + public readonly projects: Projects + public readonly issues: Issues + public readonly notes: Notes + public readonly users: Users + public readonly labels: Labels + public options: IApiBase; + public handleOptions(): void; public init(): object; } diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts index 775e1348fc..98d1ebf10a 100644 --- a/types/gitlab/Models/ProjectHooks.d.ts +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -5,10 +5,12 @@ interface IAddParam { [key: string]: any; } +type HooksCb = (hooks: any[]) => any; + export class ProjectHooks extends BaseModel { - public list(projectId: TId, fn?: Function): any; + public list(projectId: TId, fn?: HooksCb): any; public show(projectId: TId, hookId: number, fn?: Function): any; public add(projectId: TId, params: IAddParam | string, fn?: Function): any; - public update(projectId: TId, hookId: number, url: any, fn?: Function): any; + public update(projectId: TId, hookId: number, url: string, fn?: Function): any; public remove(projectId: TId, hookId: number, fn?: Function): any; } diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts index 85df8bc026..1691db52c0 100644 --- a/types/gitlab/Models/ProjectRepository.d.ts +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -1,12 +1,20 @@ import { BaseModel, TId } from '../BaseModel.d'; -interface IShowFileParam { +interface IShowFileParams { file_path: string; ref?: any; file_id?: any; [key: string]: any; } +interface IAddTagParams { + id: TId; + tag_name: string; + ref: string; + message?: string; + release_description?: string; +} + export class ProjectRepository extends BaseModel { public listBranches(projectId: TId, fn?: Function): any; public showBranch(projectId: TId, branchId: string, fn?: Function): any; @@ -14,7 +22,7 @@ export class ProjectRepository extends BaseModel { public unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; public createBranch(params: object, fn?: Function): any; public deleteBranch(projectId: TId, branchId: string, fn?: Function): any; - public addTag(params: object, fn?: Function): any; + public addTag(params: IAddTagParams, fn?: Function): any; public deleteTag(projectId: TId, tagName: string, fn?: Function): any; public showTag(projectId: TId, tagName: string, fn?: Function): any; public listTags(projectId: TId, fn?: Function): any; @@ -24,7 +32,7 @@ export class ProjectRepository extends BaseModel { public listTree(projectId: TId, fn?: Function): any; public listTree(projectId: TId, params?: object, fn?: Function): any; public showFile(projectId: TId, fn?: Function): any; - public showFile(projectId: TId, params?: IShowFileParam, fn?: Function): any; + public showFile(projectId: TId, params?: IShowFileParams, fn?: Function): any; public createFile(params?: object, fn?: Function): any; public updateFile(params?: object, fn?: Function): any; public compare(params?: object, fn?: Function): any;