import { DataCaptureComponent } from 'scandit-web-datacapture-core'; import { ParserDataFormat } from './parser/ParserDataFormat.js'; import { ParsedDataInterface, ParserIssueInterface } from './parser/private/sdcParserInternal.js'; /** * Copyright 2021 Snap, Inc. * Copyright 2024 Scandit AG * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface ResultOutcome { type: "result"; result: T; } interface ErrorOutcome { type: "error"; error: E; } type ResultOrError = ResultOutcome | ErrorOutcome; interface ParserInterface { getIdentifier(): ResultOrError; parseString(data: string): ResultOrError; parseRawData(data: Uint8Array): ResultOrError; parseStringToJson(data: string): ResultOrError; parseRawDataToJson(data: Uint8Array): ResultOrError; setOptions(options: string): ResultOrError; asDataCaptureComponent(): ResultOrError; } interface ParserInterface_statics { create(dataFormat: ParserDataFormat): ResultOrError; } interface SdcParserModule_statics { ParserInterface: ParserInterface_statics; } export type { ParserInterface as P, ResultOrError as R, SdcParserModule_statics as S, ParserInterface_statics as a };