Update type definition files

This commit is contained in:
Arylo
2018-04-05 00:22:02 +08:00
parent d6e5b0002e
commit c4e0999444
3 changed files with 28 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;