UserPreferencesManager

See source code
Table of contents
class UserPreferencesManager {}

Constructor

Constructs a new instance of the UserPreferencesManager class

Parameters

NameDescription

user

colorScheme

"dark" | "light" | "system";

Properties

disposables

disposables: Set<() => void>;

systemColorScheme

systemColorScheme: import("@tldraw/state").Atom<"dark" | "light", unknown>;

Methods

dispose( )

dispose(): void;

getAnimationSpeed( )

getAnimationSpeed(): number;

getAreKeyboardShortcutsEnabled( )

getAreKeyboardShortcutsEnabled(): boolean;

getColor( )

getColor(): string;

getEdgeScrollSpeed( )

The speed at which the user can scroll by dragging toward the edge of the screen.

getEdgeScrollSpeed(): number;

getEnhancedA11yMode( )

getEnhancedA11yMode(): boolean;

getId( )

getId(): string;

getInputMode( )

getInputMode(): "mouse" | "trackpad" | null;

getIsDarkMode( )

getIsDarkMode(): boolean;

getIsDynamicResizeMode( )

getIsDynamicResizeMode(): boolean;

getIsPasteAtCursorMode( )

getIsPasteAtCursorMode(): boolean;

getIsSnapMode( )

getIsSnapMode(): boolean;

getIsWrapMode( )

getIsWrapMode(): boolean;

getIsZoomDirectionInverted( )

getIsZoomDirectionInverted(): boolean;

getLocale( )

getLocale(): string;

getName( )

getName(): string;

getUserPreferences( )

getUserPreferences(): {
  animationSpeed: number;
  areKeyboardShortcutsEnabled: boolean;
  color: string;
  colorScheme: "dark" | "light" | "system" | undefined;
  enhancedA11yMode: boolean;
  id: string;
  inputMode: "mouse" | "trackpad" | null;
  isDarkMode: boolean;
  isDynamicResizeMode: boolean;
  isSnapMode: boolean;
  isWrapMode: boolean;
  isZoomDirectionInverted: boolean;
  locale: string;
  name: string;
};

updateUserPreferences( )

updateUserPreferences(userPreferences: Partial<TLUserPreferences>): void;

Parameters

NameDescription

userPreferences

Partial<TLUserPreferences>;

Returns

void;

Prev
TransformedGeometry2d
Next
Vec