@openfga/syntax-transformer
Version:
Javascript implementation of ANTLR Grammar for the OpenFGA DSL and parser from and to the OpenFGA JSON Syntax
14 lines (13 loc) • 634 B
TypeScript
import type { AuthorizationModel } from "@openfga/sdk";
/**
* Configuration options for printing the DSL.
*/
export interface TransformOptions {
/**
* If true, comments are appended to types, relations, and conditions with file and module information.
*/
includeSourceInformation?: boolean;
}
export declare const transformJSONToDSL: (model: Omit<AuthorizationModel, "id">, options?: TransformOptions) => string;
export declare const transformJSONStringToDSL: (modelString: string, options?: TransformOptions) => string;
export declare function getModulesFromJSON(model: Omit<AuthorizationModel, "id">): string[];