View Source on Github

Attributes

classes

list[ Class ]

Get a recursive list of all classes in files container.

dirpath

str

Relative path of the directory.

exports

list[ TSExport ]

Get a recursive list of all exports in files container.

functions

list[ Function ]

Get a recursive list of all functions in files container.

global_vars

list[ Assignment ]

Get a recursive list of all global variables in files container.

import_statements

Get a recursive list of all import statements in files container.

imports

list[ Import ]

Get a recursive list of all imports in files container.

item_names

list[str]

Get a list of all file and subdirectory names in the directory.

name

str

Get the base name of the directory's path.

parent

Directory | None

Get the parent directory of the current directory.

path

Path

Absolute path of the directory.

symbols

list[ Symbol ]

Get a recursive list of all symbols in files container.

tree

list[ Directory | TFile]

Get a recursive list of all files and subdirectories in the directory.

Methods

files

Gets a list of all top level files in the directory.

View Source on Github

Returns

list[TFile]

A sorted list of source files in the codebase.

get_class

Get a class by name in files container.

View Source on Github

Returns

Class | None

get_export

Get an export by name in files container (supports only typescript).

View Source on Github

Returns

TSExport | None

get_file

Get a file by its name relative to the directory.

View Source on Github

Returns

TFile | None

get_function

Get a function by name in files container.

View Source on Github

Returns

Function | None

get_global_var

Get a global variable by name in files container.

View Source on Github

Returns

Assignment | None

get_import

Get an import by name in files container.

View Source on Github

Returns

Import | None

get_import_statement

Get an import statement by name in files container.

View Source on Github

Returns

get_subdirectory

Get a subdirectory by its name (relative to the directory).

View Source on Github

Returns

Directory | None

get_symbol

Get a symbol by name in files container.

View Source on Github

Returns

Symbol | None

items

Get a list of all files and subdirectories in the directory.

View Source on Github

Returns

list[ Directory | TFile]

A sorted list of files and subdirectories in the directory.

remove

Remove all the files in the files container.

View Source on Github

Returns

None

rename

Rename the directory.

View Source on Github

Returns

None

subdirectories

Get a list of all top level subdirectories in the directory.

View Source on Github

Returns

list[ Directory ]

A sorted list of subdirectories in the directory.

update_filepath

Update the filepath of the directory and its contained files.

View Source on Github

Returns

None

Was this page helpful?