Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions src/minima.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ interface State {
keeper: string
}

type Callback = (jsonresp: any) => void
type Callback = (jsonresp: unknown) => void

/**
* The MAIN Minima Callback function
Expand Down Expand Up @@ -379,7 +379,7 @@ const Minima = {

//Any Parameters..
const paramstring = Minima.webhost+"/params";
httpGetAsync(paramstring, function (jsonresp: any) {
httpGetAsync(paramstring, function (jsonresp: unknown) {
//Set it..
MINIMA_PARAMS = jsonresp;
});
Expand Down Expand Up @@ -652,10 +652,9 @@ const Minima = {

}

/**
* POST the RPC call - can be cmd/sql/file/net
*/
function MinimaRPC(type: string, data: string, callback: (jsonresp: any) => void = () => {}): void {
type RPCType = "cmd" | "sql" | "file" | "net";

function MinimaRPC(type: RPCType, data: string, callback: Callback = () => {}): void {
//And now fire off a call saving it
httpPostAsync(Minima.rpchost+"/"+type+"/"+Minima.minidappid, encodeURIComponent(data), callback);
}
Expand Down Expand Up @@ -850,7 +849,7 @@ function httpPostAsync(theUrl: string, params: string, callback: Callback): void
* @param callback
* @returns
*/
function httpGetAsync(theUrl: string, callback: (jsonresp: any) => void, logenabled: boolean = false): void {
function httpGetAsync(theUrl: string, callback: Callback, logenabled: boolean = false): void {
const xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
Expand Down