Skip to content

Commit c40cb17

Browse files
committed
type: fetchCollaborators in sheet lock plugin
1 parent 0afaac5 commit c40cb17

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

sheet.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class ShimoSheetCabinet extends CabinetBase {
99
private token: string
1010
private file: ShimoSDK.File
1111
private editorOptions: ShimoSDK.Sheet.EditorOptions
12-
private fetchCollaborators: string
12+
private fetchCollaborators: string | ShimoSDK.Sheet.FetchCollaboratorsCallback
1313
private plugins: string[]
1414
private collaboration: ShimoSDK.Common.Collaboration
1515

@@ -212,7 +212,7 @@ export default class ShimoSheetCabinet extends CabinetBase {
212212
currentUser: {
213213
id: this.user.id
214214
},
215-
permission: this.user.permission,
215+
permission: this.user.permission!,
216216
fetchCollaborators: this.fetchCollaborators
217217
}
218218
const _ = new this.sdkSheet.plugins.Lock(options)

typings/global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ declare global {
7373
export type ToolbarOptions = IToolbar.ToolbarOptions
7474
export type Lock = ILock.default
7575
export type LockOptions = ILock.LockOptions
76+
export type FetchCollaboratorsCallback = ILock.FetchCollaboratorsCallback
7677
}
7778

7879
namespace Document {

typings/sheet/plugins/lock/index.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ interface Collaborator {
1818
displayRole?: string | undefined
1919
}
2020

21+
export type FetchCollaboratorsCallback = () => Promise<Collaborator[]>
22+
2123
export interface LockOptions {
2224
editor: Editor
2325
currentUser: {
2426
id: number
2527
}
2628
permission: PermissionConfig
27-
fetchCollaborators: string
29+
fetchCollaborators: string | FetchCollaboratorsCallback
2830
}
2931
export default class Lock {
3032
constructor (opts: LockOptions);

0 commit comments

Comments
 (0)