import { type JsonApiAttributeOutAttributesGranularityEnum, type RelativeDateFilterRelativeDateFilterGranularityEnum } from "@gooddata/api-client-tiger"; import { type DateAttributeGranularity } from "@gooddata/sdk-model"; /** * Converts a tiger backend granularity to the value recognized by the SDK. The input is always a real * granularity — callers must not pass a missing one (an attribute without a granularity is not a date * attribute and should be branched on before calling this). * * Developer signal (build time): {@link TigerToSdkGranularityMap} is exhaustive over the supported tiger enum, * so a newly added backend granularity breaks the build until it is mapped or added to * {@link UNSUPPORTED_TIGER_GRANULARITIES}. * * Run time: for a value that is still not mapped (an explicitly-unsupported granularity that slipped past the * catalog filter, or a backend value newer than the client's generated enum) it never throws — it warns and * returns a neutral fallback so the client keeps working. * * @param granularity - tiger granularity */ export declare function toSdkGranularity(granularity: JsonApiAttributeOutAttributesGranularityEnum): DateAttributeGranularity; /** * Resolves the SDK granularity of a date attribute or one of its labels from the identifier alone. * * @remarks * Tiger names a date dataset's attributes and labels `.`, where the * granularity part is the tiger granularity in camel case: `order_date.minuteOfHour` is * `MINUTE_OF_HOUR`, which is `GDC.time.minute_in_hour`. Because it needs no metadata, this also works * for a date attribute that no longer exists, for example after its granularity was disabled in the * logical data model. * * @param identifier - identifier of a date attribute or of one of its labels * @returns the SDK granularity, or undefined when the identifier does not follow the pattern or names * a granularity the SDK does not model * @internal */ export declare function dateAttributeIdToSdkGranularity(identifier: string): DateAttributeGranularity | undefined; /** * Whether a tiger granularity is modeled in the SDK (i.e. maps to a real SDK granularity rather than the * fallback). Use this to drop unsupported date attributes at the boundary — e.g. so extended fiscal-calendar * granularities are excluded from the catalog instead of surfacing as the fallback granularity. */ export declare function isSupportedTigerGranularity(granularity: JsonApiAttributeOutAttributesGranularityEnum): boolean; /** * Converts granularity values recognized by the SDK into granularities known by tiger. Note that * SDK granularities are superset of those supported by tiger. * * @throws NotSupport if the input granularity is not supported by tiger */ export declare function toTigerGranularity(granularity: DateAttributeGranularity): RelativeDateFilterRelativeDateFilterGranularityEnum; //# sourceMappingURL=dateGranularityConversions.d.ts.map