import BaseAPI from './BaseAPI' ; class FilesComments extends BaseAPI { public add ( comment , file , extraArgs = { } ) { const args = { comment , file } ; return this . _post ( 'files.comments.add' , args ) ; } public delete_ ( file , id , extraArgs = { } ) { const args = { file , id } ; return this . _post ( 'files.comments.delete' , args ) ; } public edit ( comment , file , id , extraArgs = { } ) { const args = { comment , file , id } ; return this . _post ( 'files.comments.edit' , args ) ; } } export default class Files extends BaseAPI { public comments ; constructor ( token , retries_limit ) { super ( token , retries_limit ) ; this . comments = new FilesComments ( token , retries_limit ) ; } public delete_ ( file , extraArgs = { } ) { const args = { file , ... extraArgs } ; return this . _post ( 'files.delete' , args ) ; } public info ( file , count = 100 , cursor = null , limit = 0 , page = 1 , extraArgs = { } ) { const args = { file , count , cursor , limit , page , ... extraArgs } ; return this . _get ( 'files.info' , args ) ; } public list ( channel , count = 100 , page = 1 , ts_from = 0 , ts_to = 'now' , types = 'all' , user = null , extraArgs = { } ) { const args = { channel , count , page , ts_from , ts_to , types , user , ... extraArgs } ; return this . _get ( 'files.list' , args ) ; } public revokePublicURL ( file , extraArgs = { } ) { const args = { file , ... extraArgs } ; return this . _post ( 'files.revokePublicURL' , args ) ; } public sharedPublicURL ( file , extraArgs = { } ) { const args = { file , ... extraArgs } ; return this . _post ( 'files.sharedPublicURL' , args ) ; } public upload ( channel , content = null , file = null , filename = null , filetype = null , initial_comment = null , thread_ts = null , title = null , extraArgs = { } ) { const args = { channel , filename , filetype , initial_comment , thread_ts , title , ... extraArgs } ; return this . _post_file ( 'files.upload' , { content , file } , args ) ; } }