import { ContentsManager , Drive , Contents } from '@jupyterlab/services' ; /**
 * Singleton contentsService class
 */ export class CodeSnippetContentsService { drive : Drive ; contentsManager : ContentsManager ; private static instance : CodeSnippetContentsService ; private constructor ( ) { const drive = new Drive ( { name : 'snippetDrive ' } ) ; const contentsManager = new ContentsManager ( { defaultDrive : drive } ) ; this . drive = drive ; this . contentsManager = contentsManager ; } static getInstance ( ) { if ( ! this . instance ) { this . instance = new CodeSnippetContentsService ( ) ; } return this . instance ; } param path param options async save ( path , options ? ) { try { const changedModel = await this . contentsManager . save ( path , options ) ; return changedModel ; } catch ( error ) { return error ; } } }