UNPKG

@bitbybit-dev/base

Version:

Bit By Bit Developers Base CAD Library to Program Geometry

164 lines (163 loc) 4.4 kB
import { Base } from "./base-inputs"; export declare namespace Logic { enum BooleanOperatorsEnum { less = "<", lessOrEqual = "<=", greater = ">", greaterOrEqual = ">=", tripleEqual = "===", tripleNotEqual = "!==", equal = "==", notEqual = "!=" } class ComparisonDto<T> { constructor(first?: T, second?: T, operator?: BooleanOperatorsEnum); /** * First item * @default undefined */ first: T; /** * Second item * @default undefined */ second: T; /** * Operator * @default less */ operator: BooleanOperatorsEnum; } class BooleanDto { constructor(boolean?: boolean); /** * Boolean value * @default false */ boolean: boolean; } class BooleanListDto { constructor(booleans?: boolean); /** * Boolean value * @default undefined */ booleans: any; } class ValueGateDto<T> { constructor(value?: T, boolean?: boolean); /** * Value to transmit when gate will be released. When value is not released we will transmit undefined value * @default undefined */ value: T; /** * Boolean value to release the gate * @default false */ boolean: boolean; } class TwoValueGateDto<T, U> { constructor(value1?: T, value2?: U); /** * First value to check * @default undefined * @optional true */ value1?: T; /** * Second value to check * @default undefined * @optional true */ value2?: U; } class RandomBooleansDto { constructor(length?: number); /** * Length of the list * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ length: number; /** * Threshold for true value between 0 and 1. The closer the value is to 1 the more true values there will be in the list. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ trueThreshold: number; } class TwoThresholdRandomGradientDto { /** * Numbers to remap to bools * @default undefined */ numbers: number[]; /** * Threshold for the numeric value until which the output will be true * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ thresholdTotalTrue: number; /** * Threshold for the numeric value until which the output will be true * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ thresholdTotalFalse: number; /** * Number of levels to go through in between thresholds for gradient * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrLevels: number; } class ThresholdBooleanListDto { /** * Numbers to remap to bools based on threshold * @default undefined */ numbers: number[]; /** * Threshold for the numeric value until which the output will be true. * If number in the list is larger than this threshold it will become false if inverse stays false. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ threshold: number; /** * True values become false and false values become true * @default false */ inverse: boolean; } class ThresholdGapsBooleanListDto { /** * Numbers to remap to bools based on threshold * @default undefined */ numbers: number[]; /** * 2D arrays representing gaps of the thresholds on which numbers should be flipped from false to true if inverse is false. * @default undefined */ gapThresholds: Base.Vector2[]; /** * True values become false and false values become true * @default false */ inverse: boolean; } }