@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
69 lines • 2.8 kB
text/typescript
import type * as tae from 'typescript-api-extractor';
/**
* Type guard to check if a type node is an external type reference.
* Works with both class instances and serialized objects from typescript-api-extractor.
*/
export declare function isExternalType(type: unknown): type is tae.ExternalTypeNode;
/**
* Type guard to check if a type node is an intrinsic (built-in) type.
*/
export declare function isIntrinsicType(type: unknown): type is tae.IntrinsicNode;
/**
* Type guard to check if a type node is a union type.
*/
export declare function isUnionType(type: unknown): type is tae.UnionNode;
/**
* Type guard to check if a type node is an intersection type.
*/
export declare function isIntersectionType(type: unknown): type is tae.IntersectionNode;
/**
* Type guard to check if a type node is an object type.
*/
export declare function isObjectType(type: unknown): type is tae.ObjectNode;
/**
* Checks if an object type is anonymous (no authored type name).
* Anonymous objects have no typeName or use TypeScript internal names like __type, __object.
* Named types like `DialogHandle<Payload>` are NOT anonymous and should be kept as type references.
*/
export declare function isAnonymousObjectType(type: tae.ObjectNode): boolean;
/**
* Type guard to check if a type node is an array type.
*/
export declare function isArrayType(type: unknown): type is tae.ArrayNode;
/**
* Type guard to check if a type node is a class type.
* Uses a local type definition since ClassNode may not be exported from older versions.
*/
export declare function isClassType(type: unknown): type is {
kind: 'class';
};
/**
* Type guard to check if a type node is a function type.
*/
export declare function isFunctionType(type: unknown): type is tae.FunctionNode;
/**
* Type guard to check if a type node is a literal type.
*/
export declare function isLiteralType(type: unknown): type is tae.LiteralNode;
/**
* Type guard to check if a type node is an enum type.
*/
export declare function isEnumType(type: unknown): type is tae.EnumNode;
/**
* Type guard to check if a type node is a tuple type.
*/
export declare function isTupleType(type: unknown): type is tae.TupleNode;
/**
* Type guard to check if a type node is a type parameter.
*/
export declare function isTypeParameterType(type: unknown): type is tae.TypeParameterNode;
/**
* Type guard to check if a type node is a component type.
*/
export declare function isComponentType(type: unknown): type is tae.ComponentNode;
/**
* Checks if a type name is a TypeScript internal symbol name.
* Internal names like __object, __type, __function are used by TypeScript
* for anonymous type declarations and should not be displayed in output.
*/
export declare function isInternalTypeName(name: string | undefined): boolean;