---
title: "hasUseTypeshadeDirective(): function in Authoring, TypeShade"
description: "hasUseTypeshadeDirective, a function in Authoring. True when the SourceFile contains at least one top-level \"use typeshade\"."
url: https://typeshade.dev/api/hasusetypeshadedirective/
language: en
---

# `hasUseTypeshadeDirective()`

Function in Authoring

True when the SourceFile contains at least one top-level "use typeshade".

`import { hasUseTypeshadeDirective } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
function hasUseTypeshadeDirective(sourceFile: ts.SourceFile): boolean
```

## Parameters

**`sourceFile` `ts.SourceFile`**

## Return value

`boolean`

## Source

[`src/compiler/ts/directive.ts`, line 39](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/directive.ts#L39), at commit af54ddad5
