Deleted types/ folders

- these should no longer be needed because the cross-linking of packages
  makes jsdoc types Just Work ™️
This commit is contained in:
Daniel Lockyer 2022-08-04 19:42:22 +02:00
parent 8f8fcbd5e9
commit 713a81455d
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD
9 changed files with 0 additions and 139 deletions

View File

@ -1,2 +0,0 @@
declare const _exports: typeof import("./lib/AdapterManager");
export = _exports;

View File

@ -1,56 +0,0 @@
export = AdapterManager;
declare class AdapterManager {
/**
* @param {object} config
* @param {string[]} config.pathsToAdapters The paths to check, e.g. ['content/adapters', 'core/server/adapters']
* @param {(path: string) => AdapterConstructor} config.loadAdapterFromPath A function to load adapters, e.g. global.require
*/
constructor({ pathsToAdapters, loadAdapterFromPath }: {
pathsToAdapters: string[];
loadAdapterFromPath: (path: string) => AdapterConstructor;
});
/**
* @private
* @type {Object.<string, AdapterConstructor>}
*/
private baseClasses;
/**
* @private
* @type {Object.<string, Object.<string, Adapter>>}
*/
private instanceCache;
/**
* @private
* @type {string[]}
*/
private pathsToAdapters;
/**
* @private
* @type {(path: string) => AdapterConstructor}
*/
private loadAdapterFromPath;
/**
* Register an adapter type and the corresponding base class. Must be called before requesting adapters of that type
*
* @param {string} type The name for the type of adapter
* @param {AdapterConstructor} BaseClass The class from which all adapters of this type must extend
*/
registerAdapter(type: string, BaseClass: AdapterConstructor): void;
/**
* getAdapter
*
* @param {string} adapterType The type of adapter, e.g. "storage" or "scheduling"
* @param {string} adapterName The active adapter, e.g. "LocalFileStorage"
* @param {object} config The config the adapter should be instantiated with
*
* @returns {Adapter} The resolved and instantiated adapter
*/
getAdapter(adapterType: string, adapterName: string, config: object): Adapter;
}
declare namespace AdapterManager {
export { AdapterConstructor, Adapter };
}
type AdapterConstructor = new (arg1: object) => Adapter;
type Adapter = {
requiredFns: string[];
};

View File

@ -1 +0,0 @@
export {};

View File

@ -1,2 +0,0 @@
declare const _exports: typeof import("./lib/SessionFromToken");
export = _exports;

View File

@ -1,43 +0,0 @@
export = SessionFromToken;
/**
* @typedef {object} User
* @prop {string} id
*/
/**
* @typedef {import('express').Request} Req
* @typedef {import('express').Response} Res
* @typedef {import('express').NextFunction} Next
* @typedef {import('express').RequestHandler} RequestHandler
*/
/**
* Returns a connect middleware function which exchanges a token for a session
*
* @template Token
* @template Lookup
*
* @param { object } deps
* @param { (req: Req) => Promise<Token> } deps.getTokenFromRequest
* @param { (token: Token) => Promise<Lookup> } deps.getLookupFromToken
* @param { (lookup: Lookup) => Promise<User> } deps.findUserByLookup
* @param { (req: Req, res: Res, user: User) => Promise<void> } deps.createSession
* @param { boolean } deps.callNextWithError - Whether next should be call with an error or just pass through
*
* @returns {RequestHandler}
*/
declare function SessionFromToken<Token, Lookup>({ getTokenFromRequest, getLookupFromToken, findUserByLookup, createSession, callNextWithError }: {
getTokenFromRequest: (req: Req) => Promise<Token>;
getLookupFromToken: (token: Token) => Promise<Lookup>;
findUserByLookup: (lookup: Lookup) => Promise<User>;
createSession: (req: Req, res: Res, user: User) => Promise<void>;
callNextWithError: boolean;
}): RequestHandler;
declare namespace SessionFromToken {
export { User, Req, Res, Next, RequestHandler };
}
type Req = import('express').Request;
type User = {
id: string;
};
type Res = import('express').Response;
type RequestHandler = import('express').RequestHandler;
type Next = import('express').NextFunction;

View File

@ -1 +0,0 @@
export {};

View File

@ -1,8 +0,0 @@
declare function _exports({ getSession, findUserById, getOriginOfRequest }: {
getSession: (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, qs.ParsedQs, Record<string, any>>, res: import("express").Response<any, Record<string, any>>) => Promise<import("./lib/SessionService").Session>;
findUserById: (data: {
id: string;
}) => Promise<import("./lib/SessionService").User>;
getOriginOfRequest: (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, qs.ParsedQs, Record<string, any>>) => string;
}): import("./lib/SessionService").SessionService;
export = _exports;

View File

@ -1,25 +0,0 @@
declare function _exports({ getSession, findUserById, getOriginOfRequest }: {
getSession: (req: Req, res: Res) => Promise<Session>;
findUserById: (data: {
id: string;
}) => Promise<User>;
getOriginOfRequest: (req: Req) => string;
}): SessionService;
export = _exports;
export type User = {
id: string;
};
export type Session = {
destroy: (cb: (err: Error | null) => any) => void;
user_id: string;
origin: string;
user_agent: string;
ip: string;
};
export type Req = import('express').Request;
export type Res = import('express').Response;
export type SessionService = {
getUserForSession: (req: Req, res: Res) => Promise<User | null>;
destroyCurrentSession: (req: Req, res: Res) => Promise<void>;
createSessionForUser: (req: Req, res: Res, user: User) => Promise<void>;
};

View File

@ -1 +0,0 @@
export {};