1<?php 2 3/* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */ 4 5namespace ILIAS\UI\Implementation\Render; 6 7/** 8 * Provides methods to interface with javascript. 9 */ 10interface JavaScriptBinding 11{ 12 /** 13 * Create a fresh unique id. 14 * 15 * This MUST return a new id on every call. 16 * 17 * @return string 18 */ 19 public function createId(); 20 21 /** 22 * Add some JavaScript-statements to the on-load handler of the page. 23 * 24 * @param string $code 25 * @return null 26 */ 27 public function addOnLoadCode($code); 28 29 /** 30 * Get all the registered on-load javascript code for the async context, e.g. return all code 31 * inside <script> tags 32 * 33 * @return string 34 */ 35 public function getOnLoadCodeAsync(); 36} 37