@abaplint/runtime
Version:
Transpiler - Runtime
37 lines (36 loc) • 1.44 kB
TypeScript
import { DataReference, FieldSymbol, HashedTable, Integer8, Structure, Table } from "../types";
import { ICharacter } from "../types/_character";
import { INumeric } from "../types/_numeric";
export interface IReadTableOptions {
index?: INumeric | Integer8 | FieldSymbol | number;
into?: INumeric | ICharacter | Structure | Table | DataReference;
from?: INumeric | ICharacter | Structure | Table | DataReference;
referenceInto?: DataReference;
assigning?: FieldSymbol;
binarySearch?: boolean;
withTableKey?: boolean;
keyName?: string;
usesTableLine?: boolean;
withKey?: (i: any) => boolean;
withKeyValue?: {
key: (i: any) => any;
value: any;
}[];
withKeySimple?: {
[key: string]: any;
};
}
export type ReadTableReturn = {
subrc: number;
foundIndex: number;
};
/** startIndex = javascript index, return ABAP index */
export declare function searchWithKey(arr: any, withKey: (i: any) => boolean, startIndex: number | undefined, usesTableLine: boolean | undefined): {
found: any;
foundIndex: number;
};
export declare function searchWithKeyPromise(arr: any, withKey: (i: any) => Promise<boolean>, startIndex: number | undefined, usesTableLine: boolean | undefined): Promise<{
found: any;
foundIndex: number;
}>;
export declare function readTable(table: Table | HashedTable | FieldSymbol, options?: IReadTableOptions): ReadTableReturn;