-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathAutocompleteInterface.php
More file actions
48 lines (41 loc) · 1.24 KB
/
AutocompleteInterface.php
File metadata and controls
48 lines (41 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* CodeEditor for Craft CMS
*
* Provides a code editor field with Twig & Craft API autocomplete
*
* @link https://nystudio107.com
* @copyright Copyright (c) 2022 nystudio107
*/
namespace nystudio107\codeeditor\base;
use nystudio107\codeeditor\models\CompleteItem;
/**
* @author nystudio107
* @package CodeEditor
* @since 1.0.0
*/
interface AutocompleteInterface
{
// Constants
// =========================================================================
// Public Methods
// =========================================================================
/**
* Generate the complete items
*/
public function generateCompleteItems(): void;
/**
* Add a complete item to the $path, which is a . separated namespace for the item
* that indicates where in the associative array the item should appear.
*
* @param CompleteItem $item
* @param string $path The . delimited path in the autocomplete array to the item; if omitted, will be set to the $item->label
*/
public function addCompleteItem(CompleteItem $item, string $path = ''): void;
/**
* Get the array of complete items
*
* @return array
*/
public function getCompleteItems(): array;
}