@rbxts/rlog
Version:
Context-based server-side logging solution for ROBLOX projects.
43 lines • 1.51 kB
TypeScript
/**
* @license
* Copyright 2024 Daymon Littrell-Reyes
*
* 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.
*/
import { LogData } from "../common";
import { SerializationConfig } from "../configuration";
/**
* Encodes an element to a JSON string or returns the element as a string.
*
* Variant of {@link encodeToJson} that calls {@link tostring} on failure.
*
* @param element - The element to encode.
*
* @returns The JSON string if encoding is successful, otherwise the result of
* calling {@link tostring} on the element.
*
* @internal
*/
export declare function encodeToJsonOrString(element: unknown): string;
/**
* Serializes an element to a valid JSON element.
*
* @param config - The serialization configuration.
* @param element - The element to encode.
*
* @returns A copy of the element with all values encoded as JSON-safe variants.
*
* @public
*/
export declare function serialize(config: SerializationConfig, element: LogData): LogData;
//# sourceMappingURL=index.d.ts.map