UNPKG

@jupyteach/jupyterlite-contents

Version:
34 lines (33 loc) 1.14 kB
import { Contents } from '@jupyterlite/contents'; /** * A class to handle requests to /api/contents */ export class JupyteachContents extends Contents { /** * Save a file. * * @param path - The desired file path. * @param options - Optional overrides to the model. * * @returns A promise which resolves with the file content model when the file is saved. */ async save(path, options = {}) { console.log('I am in the custom save method!!!', { path, options }); // call the superclass method const out = super.save(path, options); // now do custom stuffs return out; } async newUntitled(options) { console.log('I am in the custom newUntitled method!!!', { options }); return super.newUntitled(options); } async get(path, options) { console.log('I am in the custom get method!!!', { path, options }); return super.get(path, options); } async createCheckpoint(path) { console.log('I am in the custom createCheckpoint method!!!', { path }); return super.createCheckpoint(path); } }