Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IBlocklyRegistry docstrings #76

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions packages/blockly/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,35 @@ export class BlocklyRegistry implements IBlocklyRegistry {
/**
* Register a toolbox for the editor.
*
* @argument name Name of the toolbox.
* @argument name The name of the toolbox.
*
* @argument value Toolbox to register.
* @argument toolbox The toolbox to register.
*/
registerToolbox(name: string, value: ToolboxDefinition): void {
this._toolboxes.set(name, value);
registerToolbox(name: string, toolbox: ToolboxDefinition): void {
this._toolboxes.set(name, toolbox);
}

/**
* Register new blocks.
* Register block definitions.
*
* @argument blocks Blocks to register.
* @argument blocks A list of block definitions to register.
*/
registerBlocks(blocks: BlockDefinition[]): void {
Blockly.defineBlocksWithJsonArray(blocks);
}

/**
* Register new generators.
* Register a language generator.
*
* @argument name Name of the generator.
* @argument language The language output by the generator.
*
* @argument generator Generator to register.
* @argument generator The generator to register.
*
* #### Notes
* When registering a generator, the name should correspond to the language
* used by a kernel.
*
* If you register a generator for an existing language this will be overwritten.
* If a generator already exists for the given language it is overwritten.
*/
registerGenerator(name: string, generator: Blockly.Generator): void {
this._generators.set(name, generator);
registerGenerator(language: string, generator: Blockly.Generator): void {
this._generators.set(language, generator);
}

setlanguage(language: string): void {
Expand Down
25 changes: 10 additions & 15 deletions packages/blockly/src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,28 @@ export interface IBlocklyRegistry {
/**
* Register a toolbox for the editor.
*
* @argument name Name of the toolbox.
* @argument name The name of the toolbox.
*
* @argument value Toolbox to register.
* @argument toolbox The toolbox to register.
*/
registerToolbox(name: string, value: ToolboxDefinition): void;
registerToolbox(name: string, toobox: ToolboxDefinition): void;

/**
* Register new blocks.
* Register block definitions.
*
* @argument name Name of the toolbox.
*
* @argument value Toolbox to register.
* @argument blocks A list of block definitions to register.
*/
registerBlocks(blocks: BlockDefinition[]): void;

/**
* Register new generators.
* Register a language generator.
*
* @argument name Name of the toolbox.
* @argument language The language output by the generator.
*
* @argument value Toolbox to register.
* @argument generator The generator to register.
*
* #### Notes
* When registering a generator, the name should correspond to the language
* used by a kernel.
*
* If you register a generator for an existing language this will be overwritten.
* If a generator already exists for the given language it is overwritten.
*/
registerGenerator(name: string, generator: Blockly.Generator): void;
registerGenerator(language: string, generator: Blockly.Generator): void;
}