An object that resolves relative URLs.

interface IResolver {
    isLocal?: ((url, allowRoot?) => boolean);
    resolvePath?: ((path) => Promise<null | IRenderMime.IResolvedLocation>);
    getDownloadUrl(url): Promise<string>;
    resolveUrl(url): Promise<string>;
}

Implemented by

    Properties

    isLocal?: ((url, allowRoot?) => boolean)

    Whether the URL should be handled by the resolver or not.

    Type declaration

      • (url, allowRoot?): boolean
      • Parameters

        • url: string
        • Optional allowRoot: boolean

          Whether the paths starting at Unix-style filesystem root (/) are permitted.

          Notes

          This is similar to the isLocal check in URLExt, but can also perform additional checks on whether the resolver should handle a given URL.

        Returns boolean

    resolvePath?: ((path) => Promise<null | IRenderMime.IResolvedLocation>)

    Resolve a path from Jupyter kernel to a path:

    • relative to root_dir (preferrably) this is in jupyter-server scope,
    • path understood and known by kernel (if such a path exists). Returns null if there is no file matching provided path in neither kernel nor jupyter-server contents manager.

    Type declaration

    Methods