packages feed

moonlight-triangulation-1.4.0.2: ffi/bindings/typescript/src/wire.generated.ts

// Generated from Moonlight.Triangulation.Foreign.Contract.
// Run moonlight-triangulation-ffi-contract write; do not edit this file.

export const AbiStatus = {
  Ok: "ok",
  NullPointer: "null-pointer",
  CountOverflow: "count-overflow",
  BufferTooSmall: "buffer-too-small",
  GeometryObstruction: "geometry-obstruction",
  RuntimeFailure: "runtime-failure",
} as const;
export type AbiStatus = (typeof AbiStatus)[keyof typeof AbiStatus];
const abiStatusByWire: Readonly<Record<number, AbiStatus>> = {
  0: AbiStatus.Ok,
  1: AbiStatus.NullPointer,
  2: AbiStatus.CountOverflow,
  3: AbiStatus.BufferTooSmall,
  4: AbiStatus.GeometryObstruction,
  5: AbiStatus.RuntimeFailure,
};
export function decodeAbiStatus(value: number): AbiStatus | undefined {
  return abiStatusByWire[value];
}

export const ObstructionCode = {
  None: "none",
  InvalidCoordinate: "invalid-coordinate",
  PointLocationFailed: "point-location-failed",
  LocationWalkExhausted: "location-walk-exhausted",
  RefinementInputTopologyInvalid: "refinement-input-topology-invalid",
  FreshInsertionMatchedExistingVertex: "fresh-insertion-matched-existing-vertex",
  DegenerateLineEndpointMissingOutgoing: "degenerate-line-endpoint-missing-outgoing",
  DegenerateLineEndpointTurnMissing: "degenerate-line-endpoint-turn-missing",
  DegenerateLineConnectedVertexMissing: "degenerate-line-connected-vertex-missing",
  HullStartNotVisible: "hull-start-not-visible",
  OuterRangeDidNotTerminate: "outer-range-did-not-terminate",
  OuterRangeContainsInnerEdge: "outer-range-contains-inner-edge",
  ConstrainedEdgeFlipRefused: "constrained-edge-flip-refused",
  RemovalVertexOutOfRange: "removal-vertex-out-of-range",
  RemovalEdgeOutOfRange: "removal-edge-out-of-range",
  RemovalFaceOutOfRange: "removal-face-out-of-range",
  RemovalFaceCycleDidNotTerminate: "removal-face-cycle-did-not-terminate",
  RemovalEmptyTriangulation: "removal-empty-triangulation",
  RemovalTwoPointDegreeMismatch: "removal-two-point-degree-mismatch",
  RemovalCollinearDegreeMismatch: "removal-collinear-degree-mismatch",
  RemovalBorderTooShort: "removal-border-too-short",
  RemovalBorderArityMismatch: "removal-border-arity-mismatch",
  RemovalOutgoingCycleDidNotTerminate: "removal-outgoing-cycle-did-not-terminate",
  CircleSweepHullEmpty: "circle-sweep-hull-empty",
  OuterCycleDidNotTerminate: "outer-cycle-did-not-terminate",
  HierarchyLevelPopulationMismatch: "hierarchy-level-population-mismatch",
  HierarchyInsertionHandleMismatch: "hierarchy-insertion-handle-mismatch",
  PointIndexCapacityExhausted: "point-index-capacity-exhausted",
  RefinementMinimumAngleNotFinite: "refinement-minimum-angle-not-finite",
  RefinementMinimumAngleOutOfRange: "refinement-minimum-angle-out-of-range",
  RefinementMinimumAngleDerivedRatioNotFinite: "refinement-minimum-angle-derived-ratio-not-finite",
  RefinementMaximumAdditionalVerticesNegative: "refinement-maximum-additional-vertices-negative",
  RefinementMinimumAreaNotFinite: "refinement-minimum-area-not-finite",
  RefinementMinimumAreaNegative: "refinement-minimum-area-negative",
  RefinementMaximumAreaNotFinite: "refinement-maximum-area-not-finite",
  RefinementMaximumAreaNotPositive: "refinement-maximum-area-not-positive",
  RefinementMaximumRadiusEdgeRatioNotFinite: "refinement-maximum-radius-edge-ratio-not-finite",
  RefinementMaximumRadiusEdgeRatioNotPositive: "refinement-maximum-radius-edge-ratio-not-positive",
  RefinementMinimumAreaExceedsMaximum: "refinement-minimum-area-exceeds-maximum",
  RefinementSeedFaceNotActive: "refinement-seed-face-not-active",
  RefinementDomainInterfaceEdgeNotActive: "refinement-domain-interface-edge-not-active",
  RefinementDomainInterfaceMissing: "refinement-domain-interface-missing",
  RefinementDomainInterfaceExtraneous: "refinement-domain-interface-extraneous",
  RefinementDomainTopologyChanged: "refinement-domain-topology-changed",
  RefinementDomainRequiresConvexHullPreservation: "refinement-domain-requires-convex-hull-preservation",
  RefinementDomainRequiresConstraintPreservation: "refinement-domain-requires-constraint-preservation",
  RefinementDomainForbidsOuterFaceExclusion: "refinement-domain-forbids-outer-face-exclusion",
  RefinementDomainWouldCrossInterface: "refinement-domain-would-cross-interface",
  RefinementDomainWouldRewriteProtectedFace: "refinement-domain-would-rewrite-protected-face",
  RefinementDomainProtectedFaceChanged: "refinement-domain-protected-face-changed",
  CapacityExceeded: "capacity-exceeded",
  HalfEdgeCapacityExceeded: "half-edge-capacity-exceeded",
  FaceCapacityExceeded: "face-capacity-exceeded",
  PayloadStorageFailure: "payload-storage-failure",
  CoordinatePayloadCountMismatch: "coordinate-payload-count-mismatch",
  CircleSweepRequiresDenseStorage: "circle-sweep-requires-dense-storage",
  SeamFrontierUnavailable: "seam-frontier-unavailable",
  RefinementDomainRequiresFiniteVertexBudget: "refinement-domain-requires-finite-vertex-budget",
  SeamSourceEdgeRequiresFlip: "seam-source-edge-requires-flip",
  SeamProtectedSourceFaceChanged: "seam-protected-source-face-changed",
  RefinementMaximumEdgeLengthNotFinite: "refinement-maximum-edge-length-not-finite",
  RefinementMaximumEdgeLengthNotPositive: "refinement-maximum-edge-length-not-positive",
  RefinementOversizedEdge: "refinement-oversized-edge",
  RefinementSeamBridgeBudgetExceeded: "refinement-seam-bridge-budget-exceeded",
  RefinementSeamBridgeMidpointCollapsed: "refinement-seam-bridge-midpoint-collapsed",
  BoundarySplitRequiresBoundaryEdge: "boundary-split-requires-boundary-edge",
  RefinementDomainInterfaceOppositeFaceNotPermitted: "refinement-domain-interface-opposite-face-not-permitted",
  NullPointer: "null-pointer",
  CountOverflow: "count-overflow",
  BufferTooSmall: "buffer-too-small",
  RuntimeFailure: "runtime-failure",
  RegionLayoutInvalid: "region-layout-invalid",
  RegionValidationFailed: "region-validation-failed",
  OverlayFailed: "overlay-failed",
  RegionPublicationFailed: "region-publication-failed",
  ValuationFailed: "valuation-failed",
  MinkowskiFailed: "minkowski-failed",
  RegionProjectionFailed: "region-projection-failed",
} as const;
export type ObstructionCode = (typeof ObstructionCode)[keyof typeof ObstructionCode];
const obstructionCodeByWire: Readonly<Record<number, ObstructionCode>> = {
  0: ObstructionCode.None,
  1: ObstructionCode.InvalidCoordinate,
  2: ObstructionCode.PointLocationFailed,
  3: ObstructionCode.LocationWalkExhausted,
  4: ObstructionCode.RefinementInputTopologyInvalid,
  5: ObstructionCode.FreshInsertionMatchedExistingVertex,
  6: ObstructionCode.DegenerateLineEndpointMissingOutgoing,
  7: ObstructionCode.DegenerateLineEndpointTurnMissing,
  8: ObstructionCode.DegenerateLineConnectedVertexMissing,
  9: ObstructionCode.HullStartNotVisible,
  10: ObstructionCode.OuterRangeDidNotTerminate,
  11: ObstructionCode.OuterRangeContainsInnerEdge,
  12: ObstructionCode.ConstrainedEdgeFlipRefused,
  13: ObstructionCode.RemovalVertexOutOfRange,
  14: ObstructionCode.RemovalEdgeOutOfRange,
  15: ObstructionCode.RemovalFaceOutOfRange,
  16: ObstructionCode.RemovalFaceCycleDidNotTerminate,
  17: ObstructionCode.RemovalEmptyTriangulation,
  18: ObstructionCode.RemovalTwoPointDegreeMismatch,
  19: ObstructionCode.RemovalCollinearDegreeMismatch,
  20: ObstructionCode.RemovalBorderTooShort,
  21: ObstructionCode.RemovalBorderArityMismatch,
  22: ObstructionCode.RemovalOutgoingCycleDidNotTerminate,
  23: ObstructionCode.CircleSweepHullEmpty,
  24: ObstructionCode.OuterCycleDidNotTerminate,
  25: ObstructionCode.HierarchyLevelPopulationMismatch,
  26: ObstructionCode.HierarchyInsertionHandleMismatch,
  27: ObstructionCode.PointIndexCapacityExhausted,
  28: ObstructionCode.RefinementMinimumAngleNotFinite,
  29: ObstructionCode.RefinementMinimumAngleOutOfRange,
  30: ObstructionCode.RefinementMinimumAngleDerivedRatioNotFinite,
  31: ObstructionCode.RefinementMaximumAdditionalVerticesNegative,
  32: ObstructionCode.RefinementMinimumAreaNotFinite,
  33: ObstructionCode.RefinementMinimumAreaNegative,
  34: ObstructionCode.RefinementMaximumAreaNotFinite,
  35: ObstructionCode.RefinementMaximumAreaNotPositive,
  36: ObstructionCode.RefinementMaximumRadiusEdgeRatioNotFinite,
  37: ObstructionCode.RefinementMaximumRadiusEdgeRatioNotPositive,
  38: ObstructionCode.RefinementMinimumAreaExceedsMaximum,
  39: ObstructionCode.RefinementSeedFaceNotActive,
  40: ObstructionCode.RefinementDomainInterfaceEdgeNotActive,
  41: ObstructionCode.RefinementDomainInterfaceMissing,
  42: ObstructionCode.RefinementDomainInterfaceExtraneous,
  43: ObstructionCode.RefinementDomainTopologyChanged,
  44: ObstructionCode.RefinementDomainRequiresConvexHullPreservation,
  45: ObstructionCode.RefinementDomainRequiresConstraintPreservation,
  46: ObstructionCode.RefinementDomainForbidsOuterFaceExclusion,
  47: ObstructionCode.RefinementDomainWouldCrossInterface,
  48: ObstructionCode.RefinementDomainWouldRewriteProtectedFace,
  49: ObstructionCode.RefinementDomainProtectedFaceChanged,
  50: ObstructionCode.CapacityExceeded,
  51: ObstructionCode.HalfEdgeCapacityExceeded,
  52: ObstructionCode.FaceCapacityExceeded,
  53: ObstructionCode.PayloadStorageFailure,
  54: ObstructionCode.CoordinatePayloadCountMismatch,
  55: ObstructionCode.CircleSweepRequiresDenseStorage,
  56: ObstructionCode.SeamFrontierUnavailable,
  57: ObstructionCode.RefinementDomainRequiresFiniteVertexBudget,
  58: ObstructionCode.SeamSourceEdgeRequiresFlip,
  59: ObstructionCode.SeamProtectedSourceFaceChanged,
  60: ObstructionCode.RefinementMaximumEdgeLengthNotFinite,
  61: ObstructionCode.RefinementMaximumEdgeLengthNotPositive,
  62: ObstructionCode.RefinementOversizedEdge,
  63: ObstructionCode.RefinementSeamBridgeBudgetExceeded,
  64: ObstructionCode.RefinementSeamBridgeMidpointCollapsed,
  65: ObstructionCode.BoundarySplitRequiresBoundaryEdge,
  66: ObstructionCode.RefinementDomainInterfaceOppositeFaceNotPermitted,
  100: ObstructionCode.NullPointer,
  101: ObstructionCode.CountOverflow,
  102: ObstructionCode.BufferTooSmall,
  103: ObstructionCode.RuntimeFailure,
  200: ObstructionCode.RegionLayoutInvalid,
  201: ObstructionCode.RegionValidationFailed,
  202: ObstructionCode.OverlayFailed,
  203: ObstructionCode.RegionPublicationFailed,
  204: ObstructionCode.ValuationFailed,
  205: ObstructionCode.MinkowskiFailed,
  206: ObstructionCode.RegionProjectionFailed,
};
export function decodeObstructionCode(value: number): ObstructionCode | undefined {
  return obstructionCodeByWire[value];
}

export const CoordinateError = {
  None: "none",
  Nan: "nan",
  Infinite: "infinite",
  TooSmall: "too-small",
  TooLarge: "too-large",
} as const;
export type CoordinateError = (typeof CoordinateError)[keyof typeof CoordinateError];
const coordinateErrorByWire: Readonly<Record<number, CoordinateError>> = {
  0: CoordinateError.None,
  1: CoordinateError.Nan,
  2: CoordinateError.Infinite,
  3: CoordinateError.TooSmall,
  4: CoordinateError.TooLarge,
};
export function decodeCoordinateError(value: number): CoordinateError | undefined {
  return coordinateErrorByWire[value];
}

export const RegionLocation = {
  Exterior: "exterior",
  Boundary: "boundary",
  Interior: "interior",
} as const;
export type RegionLocation = (typeof RegionLocation)[keyof typeof RegionLocation];
const regionLocationByWire: Readonly<Record<number, RegionLocation>> = {
  0: RegionLocation.Exterior,
  1: RegionLocation.Boundary,
  2: RegionLocation.Interior,
};
export function decodeRegionLocation(value: number): RegionLocation | undefined {
  return regionLocationByWire[value];
}

export const MinkowskiOperation = {
  Addition: "addition",
  Erosion: "erosion",
  Opening: "opening",
  Closing: "closing",
} as const;
export type MinkowskiOperation = (typeof MinkowskiOperation)[keyof typeof MinkowskiOperation];
const minkowskiOperationByWire: Readonly<Record<number, MinkowskiOperation>> = {
  0: MinkowskiOperation.Addition,
  1: MinkowskiOperation.Erosion,
  2: MinkowskiOperation.Opening,
  3: MinkowskiOperation.Closing,
};
export function decodeMinkowskiOperation(value: number): MinkowskiOperation | undefined {
  return minkowskiOperationByWire[value];
}