Skip to content

Commit

Permalink
merge with devel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Sep 15, 2023
2 parents 7916219 + f2dea16 commit e96cbbc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Update
run: sudo apt-get update
- name: Install ImageMagick
run: sudo apt-get -y install graphicsmagick
- name: checkout
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.37.2
### Bugfix
* fix for TypeScript from [Antoine](https://github.com/antoineol) ([#896](https://github.com/jcubic/jquery.terminal/pull/896)) and [KiddoV](https://github.com/KiddoV) ([#901](https://github.com/jcubic/jquery.terminal/pull/901))

## 2.37.1
### Bugfix
* fix wrong calculation of characters with custom font [#892](https://github.com/jcubic/jquery.terminal/issues/892)
Expand Down
7 changes: 6 additions & 1 deletion js/jquery.terminal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type TypeOrPromise<T> = T | PromiseLike<T>;

declare namespace JQueryTerminal {
type interpreterFunction = (this: JQueryTerminal, command: string, term: JQueryTerminal) => any;
type terminalObjectFunction = (...args: (string | number | RegExp)[]) => (void | TypeOrPromise<simpleEchoValue>);
type terminalObjectFunction = (this: JQueryTerminal, ...args: (string | number | RegExp)[]) => (void | TypeOrPromise<simpleEchoValue>);
type Interpreter = string | interpreterFunction | ObjectInterpreter;
type ObjectInterpreter = {
[key: string]: ObjectInterpreter | terminalObjectFunction;
Expand Down Expand Up @@ -828,3 +828,8 @@ interface JQueryTerminal<TElement = HTMLElement> extends JQuery<TElement> {
scroll_to_bottom(): JQueryTerminal;
is_bottom(): boolean;
}

declare module 'jquery.terminal' {
const JQTerminal: (window: Window, JQuery: JQueryStatic) => void;
export default JQTerminal;
}
5 changes: 5 additions & 0 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ $('.term').terminal([obj_interpreter]);
$('.term').terminal(["foo.php", obj_interpreter]);
$('.term').terminal(["foo.php", obj_interpreter, function(command) {
}]);
$('.term').terminal({
help: function () {
this.echo('Help command');
}
});

class Foo {
x: string;
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2015", "ES2018.Promise", "dom"]
"lib": ["es2015", "ES2018.Promise", "dom"],
"noImplicitThis": true
},
"exclude": ["npm"]
}

0 comments on commit e96cbbc

Please sign in to comment.