API Reference
interfaces
Language

@coasys/ad4m / Exports / Language

Interface: Language

Interface of AD4M Languages

Any JavaScript module that implements a create() function that returns an object that implements this interface is a valid AD4M language. So the AD4M-internal representation of a language is an object that implements this interface.

Since there are a few different kinds of languages, this interface is split into optional sub-interfaces. The only required property is the name of the language.

The most usual kind of language is the "Expression Language", which is a language that can be used to create and share Expressions. For that, implement the expressionsAdapter and expressionUI interface.

The second most common kind of language is the "Link Language", which is a language that builds the core of AD4M Neighbourhoods. For that, implement the linksAdapter interface.

Table of contents

Properties

Methods

Properties

directMessageAdapter

Optional Readonly directMessageAdapter: DirectMessageAdapter

Optional adapter for direct messaging between agents

Defined in

language/Language.ts:65 (opens in a new tab)


expressionAdapter

Optional Readonly expressionAdapter: ExpressionAdapter

ExpressionAdapter implements means of getting an Expression by address and putting an expression

Defined in

language/Language.ts:39 (opens in a new tab)


expressionUI

Optional Readonly expressionUI: ExpressionUI

Interface for getting UI/web components for rendering Expressions of this Language

Defined in

language/Language.ts:42 (opens in a new tab)


getAllAdapter

Optional Readonly getAllAdapter: GetAllAdapter

Optional adapter for getting all Expressions

Defined in

language/Language.ts:62 (opens in a new tab)


getByAuthorAdapter

Optional Readonly getByAuthorAdapter: GetByAuthorAdapter

Optional adapter for getting Expressions by author

Defined in

language/Language.ts:60 (opens in a new tab)


languageAdapter

Optional Readonly languageAdapter: LanguageAdapter

Implementation of a Language that defines and stores Languages

Defined in

language/Language.ts:57 (opens in a new tab)


linksAdapter

Optional Readonly linksAdapter: LinkSyncAdapter

Interface of LinkLanguages for the core implementation of Neighbourhoods

Defined in

language/Language.ts:45 (opens in a new tab)


name

Readonly name: string

Defined in

language/Language.ts:27 (opens in a new tab)


settingsUI

Optional Readonly settingsUI: SettingsUI

Interface for providing UI components for the settings of this Language

Defined in

language/Language.ts:68 (opens in a new tab)


teardown

Optional Readonly teardown: () => void

Type declaration

▸ (): void

Optional function to make any cleanup/teardown if your language gets deleting in the ad4m-executor

Returns

void

Defined in

language/Language.ts:71 (opens in a new tab)


telepresenceAdapter

Optional Readonly telepresenceAdapter: TelepresenceAdapter

Additional Interface of LinkLanguages that support telepresence features, that is:

  • seeing who is online and getting a status
  • sending/receiveing p2p signals to other online agents without affecting the shared Perspective of the Neighbourhood (see TelepresenceAdapter for more details)

Defined in

language/Language.ts:54 (opens in a new tab)

Methods

interactions

interactions(expression): Interaction[]

All available interactions this agent could execute on given expression

Parameters

NameType
expressionstring

Returns

Interaction[]

Defined in

language/Language.ts:74 (opens in a new tab)


isImmutableExpression

Optional isImmutableExpression(expression): boolean

Flagging expressions as immutable to enable expression caching in the ad4m-executor

Parameters

NameType
expressionstring

Returns

boolean

Defined in

language/Language.ts:32 (opens in a new tab)