This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
declare module '@ioc:Adonis/Core/Application' {
import { ReplContract } from '@ioc:Adonis/Addons/Repl';
interface ContainerBindings {
'Adonis/Addons/Repl': ReplContract;
}
}
+8
View File
@@ -0,0 +1,8 @@
/*
* @adonisjs/repl
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
+2
View File
@@ -0,0 +1,2 @@
/// <reference path="container.d.ts" />
/// <reference path="repl.d.ts" />
+10
View File
@@ -0,0 +1,10 @@
/*
* @adonisjs/repl
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/// <reference path="./container.ts" />
/// <reference path="./repl.ts" />
+46
View File
@@ -0,0 +1,46 @@
/// <reference types="node" />
declare module '@ioc:Adonis/Addons/Repl' {
import { REPLServer } from 'repl';
import { getBest } from '@poppinss/colors';
/**
* Custom method callback
*/
export type Handler = (repl: ReplContract, ...args: any[]) => any;
/**
* Options that can be set when defining a loader
* method
*/
export type ContextOptions = {
description?: string;
usage?: string;
};
/**
* Shape of the REPL class
*/
export interface ReplContract {
colors: ReturnType<typeof getBest>;
/**
* Reference to the REPL server
*/
server: REPLServer;
/**
* Start the repl
*/
start(): this;
/**
* Notify by writing message to the console
* and resuming the prompt
*/
notify(message: string): void;
/**
* Add a method. Loader methods works as a shortcut for
*/
addMethod(name: string, handler: Handler, options?: ContextOptions): this;
/**
* Register a callback to be invoked once the server is ready
*/
ready(callback: (repl: ReplContract) => void): this;
}
const Repl: ReplContract;
export default Repl;
}
+8
View File
@@ -0,0 +1,8 @@
/*
* @adonisjs/repl
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/