Skip to content

Commit

Permalink
type: fetchCollaborators in sheet lock plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisyip committed Aug 1, 2019
1 parent 0afaac5 commit c40cb17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class ShimoSheetCabinet extends CabinetBase {
private token: string
private file: ShimoSDK.File
private editorOptions: ShimoSDK.Sheet.EditorOptions
private fetchCollaborators: string
private fetchCollaborators: string | ShimoSDK.Sheet.FetchCollaboratorsCallback
private plugins: string[]
private collaboration: ShimoSDK.Common.Collaboration

Expand Down Expand Up @@ -212,7 +212,7 @@ export default class ShimoSheetCabinet extends CabinetBase {
currentUser: {
id: this.user.id
},
permission: this.user.permission,
permission: this.user.permission!,
fetchCollaborators: this.fetchCollaborators
}
const _ = new this.sdkSheet.plugins.Lock(options)
Expand Down
1 change: 1 addition & 0 deletions typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ declare global {
export type ToolbarOptions = IToolbar.ToolbarOptions
export type Lock = ILock.default
export type LockOptions = ILock.LockOptions
export type FetchCollaboratorsCallback = ILock.FetchCollaboratorsCallback
}

namespace Document {
Expand Down
4 changes: 3 additions & 1 deletion typings/sheet/plugins/lock/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ interface Collaborator {
displayRole?: string | undefined
}

export type FetchCollaboratorsCallback = () => Promise<Collaborator[]>

export interface LockOptions {
editor: Editor
currentUser: {
id: number
}
permission: PermissionConfig
fetchCollaborators: string
fetchCollaborators: string | FetchCollaboratorsCallback
}
export default class Lock {
constructor (opts: LockOptions);
Expand Down

0 comments on commit c40cb17

Please sign in to comment.