prvni verze dynamicky ind

This commit is contained in:
David Brazda
2023-10-23 21:36:15 +02:00
parent dd90b03a30
commit 0c4fb20c66
26 changed files with 4812 additions and 580 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,277 @@
export as namespace TOML;
export = exports;
declare namespace exports {
export const version :'1.38.0';
export const parse :
& {
(this :void, source :Source, specificationVersion :1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, options? :{ readonly joiner? :string, readonly bigint? :boolean | number, readonly x ? :XOptions }) :Table;
}
& {
readonly [SpecificationVersion in 1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1] :{
(this :void, source :Source, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, options? :{ readonly joiner? :string, readonly bigint? :boolean | number, readonly x ? :XOptions }) :Table;
}
};
export function stringify (this :void, rootTable :ReadonlyTable, options? :{
readonly integer? :number
readonly newline? :'\n' | '\r\n'
readonly newlineAround? :'document' | 'section' | 'header' | 'pairs' | 'pair'
readonly indent? :string | number
readonly T? :'T' | 't' | ' '
readonly Z? :'Z' | 'z'
readonly xNull? :boolean
readonly xBeforeNewlineInMultilineTable? :',' | ''
readonly forceInlineArraySpacing? :0 | 1 | 2 | 3
}) :string;
export function isSection (this :void, table :ReadonlyTable) :boolean;
export function isInline (this :void, value :ReadonlyTable | ReadonlyArray) :boolean;
export function Section<T extends ReadonlyTable> (this :void, table :T) :T;
export function inline<T extends ReadonlyArray> (this :void, value :T, inlineMode? :0 | 1 | 2 | 3) :T;
export function inline<T extends ReadonlyTable> (this :void, value :T) :T;
export const multiline :{
readonly array :{
<T extends ReadonlyArray>
(this :void, array :T ) :T
}
<T extends ReadonlyTable>
(this :void, table :T ) :T
(this :void, value :string ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object & String
(this :void, lines :readonly string[] ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object
(this :void, lines :readonly string[], value :string) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object & String
readonly basic :{
(this :void, value :string ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object & String
(this :void, lines :readonly string[] ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object
(this :void, lines :readonly string[], value :string) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object & String
}
};
export function basic (this :void, value :string ) :{ [_literal] :`"${string}"` } & object & String;
export function literal (this :void, literal :string ) :{ [_literal] :string | [ string, ...string[] ] } & object ;
export function literal (this :void, literal :string, value :string ) :{ [_literal] :string | [ string, ...string[] ] } & object & String;
export function literal (this :void, literal :string, value :number ) :{ [_literal] :string | [ string, ...string[] ] } & object & Number;
export function literal (this :void, literal :string, value :bigint ) :{ [_literal] :string | [ string, ...string[] ] } & object & BigInt;
export function literal (this :void, literal :TemplateStringsArray, ...chars :string[]) :{ [_literal] :string | [ string, ...string[] ] } & object ;
export function commentFor (this :void, key :string) :symbol;
export const commentForThis :unique symbol;
export { OffsetDateTime, LocalDateTime, LocalDate, LocalTime, Keys };
export { exports as default };
}
declare class OffsetDateTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'OffsetDateTime';
readonly toISOString :(this :Readonly<OffsetDateTime>) => `${number}-${number}-${number}T${number}:${number}:${number}${'' | `.${number}`}${'Z' | `${'+' | '-'}${number}:${number}`}`;
readonly valueOf :(this :Readonly<OffsetDateTime>) => `${number}${'' | `.${number}`}`;
private [OffsetDateTime_ISOString] :string;
private [OffsetDateTime_value] :string;
constructor (literal :`${number}-${number}-${number}${'T' | 't' | ' '}${number}:${number}:${number}${'' | `.${number}`}${'Z' | 'z' | `${'+' | '-'}${number}:${number}`}`);
readonly getUTCFullYear :(this :Readonly<OffsetDateTime>) => _1_10000;
readonly getUTCMonth :(this :Readonly<OffsetDateTime>) => _0_11;
readonly getUTCDate :(this :Readonly<OffsetDateTime>) => _1_31;
readonly getUTCHours :(this :Readonly<OffsetDateTime>) => _0_23;
readonly getUTCMinutes :(this :Readonly<OffsetDateTime>) => _0_59;
readonly getUTCSeconds :(this :Readonly<OffsetDateTime>) => _0_59;
readonly getUTCMilliseconds :(this :Readonly<OffsetDateTime>) => _0_999;
readonly getUTCDay :(this :Readonly<OffsetDateTime>) => _0_6;
readonly getTimezoneOffset :(this :Readonly<OffsetDateTime>) => _1439_1439;
readonly getTime :(this :Readonly<OffsetDateTime>) => number;
}
declare class LocalDateTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalDateTime';
readonly toISOString :(this :Readonly<LocalDateTime>) => `${number}-${number}-${number}T${number}:${number}:${number}${'' | `.${number}`}`;
readonly valueOf :(this :Readonly<LocalDateTime>) => `${number}`;
private [LocalDateTime_ISOString] :string;
private [LocalDateTime_value] :string;
constructor (literal :`${number}-${number}-${number}${'T' | 't' | ' '}${number}:${number}:${number}${'' | `.${number}`}`);
readonly getFullYear :(this :Readonly<LocalDateTime>) => _0_9999;
readonly setFullYear :(this :LocalDateTime, year :_0_9999) => void;
readonly getMonth :(this :Readonly<LocalDateTime>) => _0_11;
readonly setMonth :(this :LocalDateTime, month :_0_11) => void;
readonly getDate :(this :Readonly<LocalDateTime>) => _1_31;
readonly setDate :(this :LocalDateTime, date :_1_31) => void;
readonly getHours :(this :Readonly<LocalDateTime>) => _0_23;
readonly setHours :(this :LocalDateTime, hours :_0_23) => void;
readonly getMinutes :(this :Readonly<LocalDateTime>) => _0_59;
readonly setMinutes :(this :LocalDateTime, min :_0_59) => void;
readonly getSeconds :(this :Readonly<LocalDateTime>) => _0_59;
readonly setSeconds :(this :LocalDateTime, sec :_0_59) => void;
readonly getMilliseconds :(this :Readonly<LocalDateTime>) => _0_999;
readonly setMilliseconds :(this :LocalDateTime, ms :_0_999) => void;
}
declare class LocalDate {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalDate';
readonly toISOString :(this :Readonly<LocalDate>) => `${number}-${number}-${number}`;
readonly valueOf :(this :Readonly<LocalDate>) => `${number}`;
private [LocalDate_ISOString] :string;
private [LocalDate_value] :string;
constructor (literal :`${number}-${number}-${number}`);
readonly getFullYear :(this :Readonly<LocalDate>) => _0_9999;
readonly setFullYear :(this :LocalDate, year :_0_9999) => void;
readonly getMonth :(this :Readonly<LocalDate>) => _0_11;
readonly setMonth :(this :LocalDate, month :_0_11) => void;
readonly getDate :(this :Readonly<LocalDate>) => _1_31;
readonly setDate :(this :LocalDate, date :_1_31) => void;
}
declare class LocalTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalTime';
readonly toISOString :(this :Readonly<LocalTime>) => `${number}:${number}:${number}${'' | `.${number}`}`;
readonly valueOf :(this :Readonly<LocalTime>) => `${number}`;
private [LocalTime_ISOString] :string;
private [LocalTime_value] :string;
constructor (literal :`${number}:${number}:${number}${'' | `.${number}`}`);
readonly getHours :(this :Readonly<LocalTime>) => _0_23;
readonly setHours :(this :LocalTime, hours :_0_23) => void;
readonly getMinutes :(this :Readonly<LocalTime>) => _0_59;
readonly setMinutes :(this :LocalTime, min :_0_59) => void;
readonly getSeconds :(this :Readonly<LocalTime>) => _0_59;
readonly setSeconds :(this :LocalTime, sec :_0_59) => void;
readonly getMilliseconds :(this :Readonly<LocalTime>) => _0_999;
readonly setMilliseconds :(this :LocalTime, ms :_0_999) => void;
}
declare class Keys extends RegExp {
readonly lastIndex :number;
constructor (keys :ArrayLike<string>);
readonly test :(this :Keys, key :string) => boolean;
}
declare const _literal :unique symbol;
type Source = string | ArrayBufferLike
| {
readonly path :string,
readonly data? :undefined,
readonly require :
| {
readonly resolve? :{ readonly paths? :undefined }
(this :void, id :'fs') :{
readonly readFileSync :(this :void, path :string) => ArrayBufferLike
}
}
| {
readonly resolve :{ readonly paths :(this :void, request :string) => null | string[] }
(this :void, id :'path') :{
readonly resolve :(this :void, dirname :string, filename :string) => string
}
(this :void, id :'fs') :{
readonly readFileSync :(this :void, path :string) => ArrayBufferLike
}
},
}
| {
readonly path :string,
readonly data :string | ArrayBufferLike,
readonly require? :
| {
readonly resolve? :{ readonly paths? :undefined }
}
| {
readonly resolve :{ readonly paths :(this :void, request :string) => null | string[] }
(this :void, id :'path') :{
readonly resolve :(this :void, dirname :string, filename :string) => string
}
},
};
type XOptions = null | {
readonly keys? :null | Keys,
readonly order? :boolean,
readonly exact? :boolean,
readonly multi? :boolean,
readonly longer? :boolean,
readonly string? :boolean,
readonly comment? :boolean,
readonly literal? :boolean,
readonly null? :boolean,
readonly tag? :null | (
<Table extends object & { [key :string | symbol] :any }, Key extends string | symbol, Array extends any[], Index extends number, Tag extends string>
(this :void, each :
| { table :Table, key :Key, tag :Tag }
| { array :Array, index :Index, tag :Tag }
| { table :Table, key :Key, array :Array, index :Index, tag :Tag }
) => void
),
};
type ReadonlyTable = object & { readonly [key :string] :ReadonlyValue };
type ReadonlyArray = readonly ReadonlyValue[];
type ReadonlyValue =
| { readonly [_literal] :string | readonly [ string, ...string[] ] } & object
| null | boolean | bigint | number | string
| ReadonlyDatetime | ReadonlyArray | ReadonlyTable
;
interface ReadonlyDatetime { readonly toISOString :(this :this) => string }
type Table = object & { [key :string] :Value };
type Array = Value[];
type Value =
| object & BigInt & { [_literal] :string }
| object & Number & { [_literal] :string }
| object & String & { [_literal] :string | [ string, ...string[] ] }
| null | boolean | bigint | number | string
| Datetime | Array | Table
;
type Datetime = OffsetDateTime | LocalDateTime | LocalDate | LocalTime;
declare const OffsetDateTime_ISOString :unique symbol;
declare const OffsetDateTime_value :unique symbol;
declare const LocalDateTime_ISOString :unique symbol;
declare const LocalDateTime_value :unique symbol;
declare const LocalDate_ISOString :unique symbol;
declare const LocalDate_value :unique symbol;
declare const LocalTime_ISOString :unique symbol;
declare const LocalTime_value :unique symbol;
type _1439_1439 = -1439 | {} & number | 1439;
type _1_10000 = -1 | {} & number | 10000;
type _0_9999 = 0 | {} & number | 9999;
type _0_999 = 0 | {} & number | 999;
type _0_6 = 0 | 1 | 2 | 3 | 4 | 5 | 6;
type _0_11 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
type _0_23 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
type _1_31 = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
type _0_59 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,277 @@
export as namespace TOML;
export = exports;
declare namespace exports {
export const version :'1.38.0';
export const parse :
& {
(this :void, source :Source, specificationVersion :1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, options? :{ readonly joiner? :string, readonly bigint? :boolean | number, readonly x ? :XOptions }) :Table;
}
& {
readonly [SpecificationVersion in 1.0 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1] :{
(this :void, source :Source, multilineStringJoiner? :string, useBigInt? :boolean | number, xOptions? :XOptions ) :Table;
(this :void, source :Source, options? :{ readonly joiner? :string, readonly bigint? :boolean | number, readonly x ? :XOptions }) :Table;
}
};
export function stringify (this :void, rootTable :ReadonlyTable, options? :{
readonly integer? :number
readonly newline? :'\n' | '\r\n'
readonly newlineAround? :'document' | 'section' | 'header' | 'pairs' | 'pair'
readonly indent? :string | number
readonly T? :'T' | 't' | ' '
readonly Z? :'Z' | 'z'
readonly xNull? :boolean
readonly xBeforeNewlineInMultilineTable? :',' | ''
readonly forceInlineArraySpacing? :0 | 1 | 2 | 3
}) :string;
export function isSection (this :void, table :ReadonlyTable) :boolean;
export function isInline (this :void, value :ReadonlyTable | ReadonlyArray) :boolean;
export function Section<T extends ReadonlyTable> (this :void, table :T) :T;
export function inline<T extends ReadonlyArray> (this :void, value :T, inlineMode? :0 | 1 | 2 | 3) :T;
export function inline<T extends ReadonlyTable> (this :void, value :T) :T;
export const multiline :{
readonly array :{
<T extends ReadonlyArray>
(this :void, array :T ) :T
}
<T extends ReadonlyTable>
(this :void, table :T ) :T
(this :void, value :string ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object & String
(this :void, lines :readonly string[] ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object
(this :void, lines :readonly string[], value :string) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] | [ `'''`, ...string[], `${string}'''` ] } & object & String
readonly basic :{
(this :void, value :string ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object & String
(this :void, lines :readonly string[] ) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object
(this :void, lines :readonly string[], value :string) :{ [_literal] :[ `"""`, ...string[], `${string}"""` ] } & object & String
}
};
export function basic (this :void, value :string ) :{ [_literal] :`"${string}"` } & object & String;
export function literal (this :void, literal :string ) :{ [_literal] :string | [ string, ...string[] ] } & object ;
export function literal (this :void, literal :string, value :string ) :{ [_literal] :string | [ string, ...string[] ] } & object & String;
export function literal (this :void, literal :string, value :number ) :{ [_literal] :string | [ string, ...string[] ] } & object & Number;
export function literal (this :void, literal :string, value :bigint ) :{ [_literal] :string | [ string, ...string[] ] } & object & BigInt;
export function literal (this :void, literal :TemplateStringsArray, ...chars :string[]) :{ [_literal] :string | [ string, ...string[] ] } & object ;
export function commentFor (this :void, key :string) :symbol;
export const commentForThis :unique symbol;
export { OffsetDateTime, LocalDateTime, LocalDate, LocalTime, Keys };
export { exports as default };
}
declare class OffsetDateTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'OffsetDateTime';
readonly toISOString :(this :Readonly<OffsetDateTime>) => `${number}-${number}-${number}T${number}:${number}:${number}${'' | `.${number}`}${'Z' | `${'+' | '-'}${number}:${number}`}`;
readonly valueOf :(this :Readonly<OffsetDateTime>) => `${number}${'' | `.${number}`}`;
private [OffsetDateTime_ISOString] :string;
private [OffsetDateTime_value] :string;
constructor (literal :`${number}-${number}-${number}${'T' | 't' | ' '}${number}:${number}:${number}${'' | `.${number}`}${'Z' | 'z' | `${'+' | '-'}${number}:${number}`}`);
readonly getUTCFullYear :(this :Readonly<OffsetDateTime>) => _1_10000;
readonly getUTCMonth :(this :Readonly<OffsetDateTime>) => _0_11;
readonly getUTCDate :(this :Readonly<OffsetDateTime>) => _1_31;
readonly getUTCHours :(this :Readonly<OffsetDateTime>) => _0_23;
readonly getUTCMinutes :(this :Readonly<OffsetDateTime>) => _0_59;
readonly getUTCSeconds :(this :Readonly<OffsetDateTime>) => _0_59;
readonly getUTCMilliseconds :(this :Readonly<OffsetDateTime>) => _0_999;
readonly getUTCDay :(this :Readonly<OffsetDateTime>) => _0_6;
readonly getTimezoneOffset :(this :Readonly<OffsetDateTime>) => _1439_1439;
readonly getTime :(this :Readonly<OffsetDateTime>) => number;
}
declare class LocalDateTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalDateTime';
readonly toISOString :(this :Readonly<LocalDateTime>) => `${number}-${number}-${number}T${number}:${number}:${number}${'' | `.${number}`}`;
readonly valueOf :(this :Readonly<LocalDateTime>) => `${number}`;
private [LocalDateTime_ISOString] :string;
private [LocalDateTime_value] :string;
constructor (literal :`${number}-${number}-${number}${'T' | 't' | ' '}${number}:${number}:${number}${'' | `.${number}`}`);
readonly getFullYear :(this :Readonly<LocalDateTime>) => _0_9999;
readonly setFullYear :(this :LocalDateTime, year :_0_9999) => void;
readonly getMonth :(this :Readonly<LocalDateTime>) => _0_11;
readonly setMonth :(this :LocalDateTime, month :_0_11) => void;
readonly getDate :(this :Readonly<LocalDateTime>) => _1_31;
readonly setDate :(this :LocalDateTime, date :_1_31) => void;
readonly getHours :(this :Readonly<LocalDateTime>) => _0_23;
readonly setHours :(this :LocalDateTime, hours :_0_23) => void;
readonly getMinutes :(this :Readonly<LocalDateTime>) => _0_59;
readonly setMinutes :(this :LocalDateTime, min :_0_59) => void;
readonly getSeconds :(this :Readonly<LocalDateTime>) => _0_59;
readonly setSeconds :(this :LocalDateTime, sec :_0_59) => void;
readonly getMilliseconds :(this :Readonly<LocalDateTime>) => _0_999;
readonly setMilliseconds :(this :LocalDateTime, ms :_0_999) => void;
}
declare class LocalDate {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalDate';
readonly toISOString :(this :Readonly<LocalDate>) => `${number}-${number}-${number}`;
readonly valueOf :(this :Readonly<LocalDate>) => `${number}`;
private [LocalDate_ISOString] :string;
private [LocalDate_value] :string;
constructor (literal :`${number}-${number}-${number}`);
readonly getFullYear :(this :Readonly<LocalDate>) => _0_9999;
readonly setFullYear :(this :LocalDate, year :_0_9999) => void;
readonly getMonth :(this :Readonly<LocalDate>) => _0_11;
readonly setMonth :(this :LocalDate, month :_0_11) => void;
readonly getDate :(this :Readonly<LocalDate>) => _1_31;
readonly setDate :(this :LocalDate, date :_1_31) => void;
}
declare class LocalTime {
readonly toJSON :Date['toJSON'];
readonly [Symbol.toStringTag] :'LocalTime';
readonly toISOString :(this :Readonly<LocalTime>) => `${number}:${number}:${number}${'' | `.${number}`}`;
readonly valueOf :(this :Readonly<LocalTime>) => `${number}`;
private [LocalTime_ISOString] :string;
private [LocalTime_value] :string;
constructor (literal :`${number}:${number}:${number}${'' | `.${number}`}`);
readonly getHours :(this :Readonly<LocalTime>) => _0_23;
readonly setHours :(this :LocalTime, hours :_0_23) => void;
readonly getMinutes :(this :Readonly<LocalTime>) => _0_59;
readonly setMinutes :(this :LocalTime, min :_0_59) => void;
readonly getSeconds :(this :Readonly<LocalTime>) => _0_59;
readonly setSeconds :(this :LocalTime, sec :_0_59) => void;
readonly getMilliseconds :(this :Readonly<LocalTime>) => _0_999;
readonly setMilliseconds :(this :LocalTime, ms :_0_999) => void;
}
declare class Keys extends RegExp {
readonly lastIndex :number;
constructor (keys :ArrayLike<string>);
readonly test :(this :Keys, key :string) => boolean;
}
declare const _literal :unique symbol;
type Source = string | ArrayBufferLike
| {
readonly path :string,
readonly data? :undefined,
readonly require :
| {
readonly resolve? :{ readonly paths? :undefined }
(this :void, id :'fs') :{
readonly readFileSync :(this :void, path :string) => ArrayBufferLike
}
}
| {
readonly resolve :{ readonly paths :(this :void, request :string) => null | string[] }
(this :void, id :'path') :{
readonly resolve :(this :void, dirname :string, filename :string) => string
}
(this :void, id :'fs') :{
readonly readFileSync :(this :void, path :string) => ArrayBufferLike
}
},
}
| {
readonly path :string,
readonly data :string | ArrayBufferLike,
readonly require? :
| {
readonly resolve? :{ readonly paths? :undefined }
}
| {
readonly resolve :{ readonly paths :(this :void, request :string) => null | string[] }
(this :void, id :'path') :{
readonly resolve :(this :void, dirname :string, filename :string) => string
}
},
};
type XOptions = null | {
readonly keys? :null | Keys,
readonly order? :boolean,
readonly exact? :boolean,
readonly multi? :boolean,
readonly longer? :boolean,
readonly string? :boolean,
readonly comment? :boolean,
readonly literal? :boolean,
readonly null? :boolean,
readonly tag? :null | (
<Table extends object & { [key :string | symbol] :any }, Key extends string | symbol, Array extends any[], Index extends number, Tag extends string>
(this :void, each :
| { table :Table, key :Key, tag :Tag }
| { array :Array, index :Index, tag :Tag }
| { table :Table, key :Key, array :Array, index :Index, tag :Tag }
) => void
),
};
type ReadonlyTable = object & { readonly [key :string] :ReadonlyValue };
type ReadonlyArray = readonly ReadonlyValue[];
type ReadonlyValue =
| { readonly [_literal] :string | readonly [ string, ...string[] ] } & object
| null | boolean | bigint | number | string
| ReadonlyDatetime | ReadonlyArray | ReadonlyTable
;
interface ReadonlyDatetime { readonly toISOString :(this :this) => string }
type Table = object & { [key :string] :Value };
type Array = Value[];
type Value =
| object & BigInt & { [_literal] :string }
| object & Number & { [_literal] :string }
| object & String & { [_literal] :string | [ string, ...string[] ] }
| null | boolean | bigint | number | string
| Datetime | Array | Table
;
type Datetime = OffsetDateTime | LocalDateTime | LocalDate | LocalTime;
declare const OffsetDateTime_ISOString :unique symbol;
declare const OffsetDateTime_value :unique symbol;
declare const LocalDateTime_ISOString :unique symbol;
declare const LocalDateTime_value :unique symbol;
declare const LocalDate_ISOString :unique symbol;
declare const LocalDate_value :unique symbol;
declare const LocalTime_ISOString :unique symbol;
declare const LocalTime_value :unique symbol;
type _1439_1439 = -1439 | {} & number | 1439;
type _1_10000 = -1 | {} & number | 10000;
type _0_9999 = 0 | {} & number | 9999;
type _0_999 = 0 | {} & number | 999;
type _0_6 = 0 | 1 | 2 | 3 | 4 | 5 | 6;
type _0_11 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
type _0_23 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
type _1_31 = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
type _0_59 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -23,6 +23,7 @@ function populate_rt_status_header(runnerId) {
success:function(data){
//console.log(JSON.stringify(data))
//add status on chart
$("#statusArchId").text(data.id)
$("#statusRegime").text("REALTIME: "+data.id)
$("#statusName").text(data.run_name)
$("#statusMode").text(data.run_mode)

View File

@@ -50,8 +50,8 @@ function refresh_stratin_and_callback(row, callback) {
contentType: "application/json",
dataType: "json",
success:function(data){
console.log("fetched data ok")
console.log(JSON.stringify(data,null,2));
//console.log("fetched data ok")
//console.log(JSON.stringify(data,null,2));
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
@@ -65,7 +65,7 @@ function refresh_stratin_and_callback(row, callback) {
// Both requests have completed successfully
//console.log("Result from request:", result);
console.log("calling calbback")
//console.log("calling calbback")
//call callback function
callback(response)
@@ -236,19 +236,19 @@ $(document).ready(function () {
filterList[i] = filterList[i].trim();
}
console.log("filter list")
console.log(filterList)
console.log(minsize)
//console.log("filter list")
//console.log(filterList)
//console.log(minsize)
var row = ""
//zakrouhleno na milisekundy
var puvodni = parseFloat(parseInt(parseFloat($('#trade-timestamp').val())*1000))/1000
console.log(puvodni)
//console.log(puvodni)
$('#trades-data-table').html(row);
data.forEach((tradeLine) => {
//console.log(JSON.stringify(tradeLine))
date = new Date(tradeLine.timestamp)
timestamp = date.getTime()/1000
console.log(timestamp)
//console.log(timestamp)
//trade contains filtered condition or size<minsize
bg = (findCommonElements3(filterList, tradeLine.conditions) || (parseInt(tradeLine.size) < minsize) ? 'style="background-color: #411e1e;"' : '')
@@ -398,8 +398,8 @@ $(document).ready(function () {
contentType: "application/json",
dataType: "json",
success:function(data){
console.log("first request ok")
console.log(JSON.stringify(data,null,2));
//("first request ok")
//console.log(JSON.stringify(data,null,2));
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
@@ -417,8 +417,8 @@ $(document).ready(function () {
contentType: "application/json",
dataType: "json",
success:function(data){
console.log("first request ok")
console.log(JSON.stringify(data,null,2));
//console.log("first request ok")
//console.log(JSON.stringify(data,null,2));
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
@@ -433,9 +433,9 @@ $(document).ready(function () {
// Both requests have completed successfully
var result1 = response1[0];
var result2 = response2[0];
console.log("Result from first request:", result1);
console.log("Result from second request:", result2);
console.log("calling compare")
// console.log("Result from first request:", result1);
// console.log("Result from second request:", result2);
// console.log("calling compare")
perform_compare(result1, result2)
// Perform your action with the results from both requests
// Example:

View File

@@ -13,14 +13,16 @@ var candlestickSeries = null
var volumeSeries = null
var vwapSeries = null
var statusBarConfig = JSON.parse(localStorage.getItem("statusBarConfig"));
var activatedButtons = []
if (statusBarConfig == null) {
statusBarConfig = {}
}
var index_ind = 0
const sorter = (a, b) => a.time > b.time ? 1 : -1;
var ind_editor = null
var indConfig = null
settings = {}
settings
@@ -56,6 +58,13 @@ var indConfig_default = [ {name: "ema", titlevisible: false, embed: true, displa
{name: "sec_price", titlevisible: true, embed: true, display: true, priceScaleId: "right", lastValueVisible: false},]
//console.log(JSON.stringify(indConfig_default, null,null, 2))
function store_activated_buttons_state() {
activatedButtons = []
//ulozime si stav aktivovaných buttonků před změnou - mozna do sluzby
$('#indicatorsButtons .switcher-active-item').each(function() {
activatedButtons.push($(this).text());
});
}
function initialize_statusheader() {
@@ -132,9 +141,11 @@ function initialize_statusheader() {
}
//pokud neni v configuraci vracime default
function get_ind_config(indName) {
def = {name: "ema", titlevisible: false, embed: true, display: true, priceScaleId: "middle", lastValueVisible: false}
if (indConfig == null) {
indConfig = get_from_config("indConfig", indConfig_default)
}
@@ -144,7 +155,7 @@ function get_ind_config(indName) {
{
return indConfig[i]
}
return null
return def
}
function toggle_vertical_line(time) {
@@ -328,25 +339,183 @@ function remove_indicator_buttons() {
elem1.remove()
}
//pomocna funkce pro vytvoreni buttonu indiaktoru
function create_indicator_button(item, index, def) {
// //div pro kazdy button
// var buttonContainer = document.createElement('div');
// buttonContainer.classList.add('button-container');
var itemEl = document.createElement('button');
itemEl.innerText = item.name;
itemEl.id = "IND"+index;
itemEl.title = item.cnf
itemEl.style.color = item.series.options().color;
//pokud jde o pridanou on the fly - vybarvime jinak
if (item.added) {
itemEl.style.outline = "solid 1px"
}
itemEl.classList.add('switcher-item');
if (def) {
itemEl.classList.add('switcher-active-item');
}
// //jeste vytvorime pod tim overlay a nad to az dame linky
// // Create the overlay element.
// const overlay = document.createElement("div");
// overlay.id = "OVR"+index;
// overlay.classList.add("overlayLayer");
// overlay.classList.add("hidden");
// // Create the action buttons.
// const actionShow = document.createElement("div");
// actionShow.id = "actionShow";
// actionShow.textContent = "Show";
itemEl.addEventListener('click', function() {
onItemClickedToggle(index);
});
// const actionEdit = document.createElement("div");
// actionEdit.id = "actionEdit";
// actionEdit.textContent = "Edit";
itemEl.addEventListener('contextmenu', function(e) {
//edit modal zatim nemame
onItemClickedEdit(e, index);
});
// // Append the action buttons to the overlay.
// overlay.appendChild(actionShow);
// overlay.appendChild(actionEdit);
// // Add a hover listener to the button.
// itemEl.addEventListener("mouseover", toggleOverlay(index));
// itemEl.addEventListener("mouseout", toggleOverlay(index));
// buttonContainer.appendChild(itemEl)
// buttonContainer.appendChild(overlay)
return itemEl
}
//pomocne funkce
function onResetClicked() {
indList.forEach(function (item, index) {
vis = true;
const elem = document.getElementById("IND"+index);
if (elem.classList.contains("switcher-active-item")) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
}
})
}
function generateIndicators(e) {
alert("stratvars generated to clipboard from selected indicators")
}
//editace indikatoru, vcetne vytvoreni noveho
function onItemClickedEdit(e, index) {
if (ind_editor) {
ind_editor.dispose()
}
title = `#[stratvars.indicators.name]
`
const elem = document.getElementById("IND"+index);
//console.log("element",elem)
//jde o update
if (elem) {
elem.classList.replace('switcher-item', 'switcher-item-highlighted');
$('#indicatorName').val(elem.textContent)
$('#indicatorNameTitle').text(elem.textContent)
title = elem.title
}
//jde o novy zaznam - davame pryc delete
else {
$('#deleteIndicatorButton').hide();
}
e.preventDefault()
//$('#stratvar_id').val(row.id);
$('#indicatorId').val(index)
require(["vs/editor/editor.main"], () => {
ind_editor = monaco.editor.create(document.getElementById('indicatorTOML_editor'), {
value: title,
language: 'toml',
theme: 'tomlTheme-dark',
automaticLayout: true
});
});
window.$('#indicatorModal').modal('show');
}
//togle profit line
function profitLineToggle() {
vis = true;
const elem = document.getElementById("profitLine");
if (elem.classList.contains("switcher-active-item")) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
//v ifu kvuli workaroundu
if (profitLine) {
profitLine.applyOptions({
visible: vis });
}
}
//toggle indiktoru
function onItemClickedToggle(index) {
vis = true;
const elem = document.getElementById("IND"+index);
if (elem.classList.contains("switcher-active-item")) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
//v ifu kvuli workaroundu
if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
}
//zatim takto workaround, pak vymyslet systemove pro vsechny tickbased indikatory
if (indList[index].name == "tick_price") {
if (!vis && indList[index].series) {
chart.removeSeries(indList[index].series)
chart.timeScale().fitContent();
indList[index].series = null
}
}
}
//funkce pro vytvoreni buttonku indikatoru
function populate_indicator_buttons(def) {
//vytvoreni outer button divu
var buttonElement = document.createElement('div');
buttonElement.id = "indicatorsButtons"
buttonElement.classList.add('switcher');
//iterace nad indikatory a vytvareni buttonků
indList.forEach(function (item, index) {
var itemEl = document.createElement('button');
itemEl.innerText = item.name;
itemEl.id = "IND"+index;
itemEl.title = item.cnf
itemEl.style.color = item.series.options().color;
itemEl.classList.add('switcher-item');
if (def) {
itemEl.classList.add('switcher-active-item');
index_ind = index
active = false
//console.log("activatedButtons", activatedButtons)
//console.log("obsahuje item.name", activatedButtons.includes(item.name), item.name)
//pokud existuje v aktivnich pak
if ((activatedButtons) && (activatedButtons.includes(item.name))) {
active = true
}
itemEl.addEventListener('click', function() {
onItemClicked1(index);
});
buttonElement.appendChild(itemEl);
//vytvoreni buttonku
itemEl = create_indicator_button(item, index, def||active);
//prirazeni do divu
buttonElement.appendChild(itemEl); ;
});
//create toggle all button
@@ -361,51 +530,47 @@ function populate_indicator_buttons(def) {
});
buttonElement.appendChild(itemEl);
function onResetClicked() {
indList.forEach(function (item, index) {
vis = true;
const elem = document.getElementById("IND"+index);
if (elem.classList.contains("switcher-active-item")) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
}
})
}
//button pro toggle profitu
var itemEl = document.createElement('button');
itemEl.innerText = "prof"
itemEl.classList.add('switcher-item');
itemEl.style.color = "#99912b"
itemEl.id = "profitLine"
itemEl.addEventListener('click', function(e) {
profitLineToggle();
});
buttonElement.appendChild(itemEl);
function onItemClicked1(index) {
vis = true;
const elem = document.getElementById("IND"+index);
if (elem.classList.contains("switcher-active-item")) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
//v ifu kvuli workaroundu
if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
}
//zatim takto workaround, pak vymyslet systemove pro vsechny tickbased indikatory
if (indList[index].name == "tick_price") {
if (!vis && indList[index].series) {
chart.removeSeries(indList[index].series)
chart.timeScale().fitContent();
indList[index].series = null
}
}
//create plus button to create new button
var itemEl = document.createElement('button');
itemEl.innerText = "+"
itemEl.classList.add('switcher-item');
//na tomto je navesena jquery pro otevreni modalu
itemEl.id = "button_addindicator"
itemEl.addEventListener('click', function(e) {
index_ind++
onItemClickedEdit(e, index_ind);
});
buttonElement.appendChild(itemEl);
//save indicator buttons - will generate indicators to stratvars
var itemEl = document.createElement('button');
itemEl.innerText = "generate"
itemEl.classList.add('switcher-item');
//na tomto je navesena jquery pro otevreni modalu
itemEl.id = "save_indicators"
itemEl.addEventListener('click', function(e) {
index_ind++
generateIndicators(e);
});
buttonElement.appendChild(itemEl);
}
return buttonElement;
return buttonElement;
}
//range switch pro chart https://jsfiddle.net/TradingView/qrb9a850/
function createSimpleSwitcher(items, activeItem, activeItemChangedCallback) {
function createSimpleSwitcher(items, activeItem, activeItemChangedCallback, data) {
var switcherElement = document.createElement('div');
switcherElement.classList.add('switcher');
@@ -432,7 +597,7 @@ function createSimpleSwitcher(items, activeItem, activeItemChangedCallback) {
activeItem = item;
activeItemChangedCallback(item);
activeItemChangedCallback(item, data);
}
return switcherElement;
@@ -485,6 +650,7 @@ function format_date(datum, markettime = false, timeonly = false) {
}
function clear_status_header() {
$("#statusArchId").text("")
$("#statusRegime").text("")
$("#statusName").text("")
$("#statusMode").text("")