Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Update resources documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nesk committed Nov 30, 2020
1 parent 121e0b7 commit 3aa9569
Show file tree
Hide file tree
Showing 25 changed files with 299 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Puppeteer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
use Nesk\Rialto\AbstractEntryPoint;
use vierbergenlars\SemVer\{version, expression, SemVerException};

/**
* @property-read mixed devices
* @property-read mixed errors
* @method \Nesk\Puphpeteer\Resources\Browser connect(array<string, mixed> $options)
* @method void registerCustomQueryHandler(string $name, mixed $queryHandler)
* @method void unregisterCustomQueryHandler(string $name)
* @method string[] customQueryHandlerNames()
* @method void clearCustomQueryHandlers()
*/
class Puppeteer extends AbstractEntryPoint
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/Accessibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method mixed snapshot(array<string, mixed> $options = null)
*/
class Accessibility extends BasicResource
{
//
Expand Down
17 changes: 17 additions & 0 deletions src/Resources/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

namespace Nesk\Puphpeteer\Resources;

/**
* @method mixed|null process()
* @method \Nesk\Puphpeteer\Resources\BrowserContext createIncognitoBrowserContext()
* @method \Nesk\Puphpeteer\Resources\BrowserContext[] browserContexts()
* @method \Nesk\Puphpeteer\Resources\BrowserContext defaultBrowserContext()
* @method string wsEndpoint()
* @method \Nesk\Puphpeteer\Resources\Page newPage()
* @method \Nesk\Puphpeteer\Resources\Target[] targets()
* @method \Nesk\Puphpeteer\Resources\Target target()
* @method \Nesk\Puphpeteer\Resources\Target waitForTarget(callable(\Nesk\Puphpeteer\Resources\Target $x): bool $predicate, array<string, mixed> $options = null)
* @method \Nesk\Puphpeteer\Resources\Page[] pages()
* @method string version()
* @method string userAgent()
* @method void close()
* @method void disconnect()
* @method bool isConnected()
*/
class Browser extends EventEmitter
{
//
Expand Down
11 changes: 11 additions & 0 deletions src/Resources/BrowserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

namespace Nesk\Puphpeteer\Resources;

/**
* @method \Nesk\Puphpeteer\Resources\Target[] targets()
* @method \Nesk\Puphpeteer\Resources\Target waitForTarget(callable(\Nesk\Puphpeteer\Resources\Target $x): bool $predicate, array{ timeout: float } $options = null)
* @method \Nesk\Puphpeteer\Resources\Page[] pages()
* @method bool isIncognito()
* @method void overridePermissions(string $origin, string[] $permissions)
* @method void clearPermissionOverrides()
* @method \Nesk\Puphpeteer\Resources\Page newPage()
* @method \Nesk\Puphpeteer\Resources\Browser browser()
* @method void close()
*/
class BrowserContext extends EventEmitter
{
//
Expand Down
10 changes: 10 additions & 0 deletions src/Resources/BrowserFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method mixed platform()
* @method mixed product()
* @method string host()
* @method bool canDownload(string $revision)
* @method mixed download(string $revision, callable(float $x, float $y): void $progressCallback = null)
* @method string[] localRevisions()
* @method void remove(string $revision)
* @method mixed revisionInfo(string $revision)
*/
class BrowserFetcher extends BasicResource
{
//
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/CDPSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace Nesk\Puphpeteer\Resources;

/**
* @method mixed send(mixed $method, mixed ...$paramArgs)
* @method void detach()
*/
class CDPSession extends EventEmitter
{
//
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/ConsoleMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method mixed type()
* @method string text()
* @method \Nesk\Puphpeteer\Resources\JSHandle[] args()
* @method mixed location()
* @method mixed[] stackTrace()
*/
class ConsoleMessage extends BasicResource
{
//
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/Coverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method void startJSCoverage(array<string, mixed> $options = null)
* @method mixed[] stopJSCoverage()
* @method void startCSSCoverage(array<string, mixed> $options = null)
* @method mixed[] stopCSSCoverage()
*/
class Coverage extends BasicResource
{
//
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method mixed type()
* @method string message()
* @method string defaultValue()
* @method void accept(string $promptText = null)
* @method void dismiss()
*/
class Dialog extends BasicResource
{
//
Expand Down
16 changes: 16 additions & 0 deletions src/Resources/ElementHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
use Nesk\Puphpeteer\Traits\AliasesSelectionMethods;
use Nesk\Puphpeteer\Traits\AliasesEvaluationMethods;

/**
* @method \Nesk\Puphpeteer\Resources\ElementHandle<mixed>|null asElement()
* @method \Nesk\Puphpeteer\Resources\Frame|null contentFrame()
* @method void hover()
* @method void click(array<string, mixed> $options = null)
* @method string[] select(string ...$values)
* @method void uploadFile(string ...$filePaths)
* @method void tap()
* @method void focus()
* @method void type(string $text, array{ delay: float } $options = null)
* @method void press(mixed $key, array<string, mixed> $options = null)
* @method mixed|null boundingBox()
* @method mixed|null boxModel()
* @method string|mixed|null screenshot(array{ } $options = null)
* @method bool isIntersectingViewport()
*/
class ElementHandle extends JSHandle
{
use AliasesSelectionMethods, AliasesEvaluationMethods;
Expand Down
10 changes: 10 additions & 0 deletions src/Resources/EventEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method \Nesk\Puphpeteer\Resources\EventEmitter on(mixed $event, mixed $handler)
* @method \Nesk\Puphpeteer\Resources\EventEmitter off(mixed $event, mixed $handler)
* @method \Nesk\Puphpeteer\Resources\EventEmitter removeListener(mixed $event, mixed $handler)
* @method \Nesk\Puphpeteer\Resources\EventEmitter addListener(mixed $event, mixed $handler)
* @method bool emit(mixed $event, mixed $eventData = null)
* @method \Nesk\Puphpeteer\Resources\EventEmitter once(mixed $event, mixed $handler)
* @method float listenerCount(mixed $event)
* @method \Nesk\Puphpeteer\Resources\EventEmitter removeAllListeners(mixed $event = null)
*/
class EventEmitter extends BasicResource
{
//
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/ExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method \Nesk\Puphpeteer\Resources\Frame|null frame()
* @method mixed evaluate(callable|string $pageFunction, mixed ...$args)
* @method \Nesk\Puphpeteer\Resources\JSHandle|\Nesk\Puphpeteer\Resources\ElementHandle evaluateHandle(callable|string $pageFunction, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method \Nesk\Puphpeteer\Resources\JSHandle queryObjects(\Nesk\Puphpeteer\Resources\JSHandle $prototypeHandle)
*/
class ExecutionContext extends BasicResource
{
//
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/FileChooser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method bool isMultiple()
* @method void accept(string[] $filePaths)
* @method void cancel()
*/
class FileChooser extends BasicResource
{
//
Expand Down
28 changes: 28 additions & 0 deletions src/Resources/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@
use Nesk\Puphpeteer\Traits\AliasesSelectionMethods;
use Nesk\Puphpeteer\Traits\AliasesEvaluationMethods;

/**
* @method \Nesk\Puphpeteer\Resources\HTTPResponse|null goto(string $url, array{ referer: string, timeout: float, waitUntil: string|string[] } $options = null)
* @method \Nesk\Puphpeteer\Resources\HTTPResponse|null waitForNavigation(array{ timeout: float, waitUntil: string|string[] } $options = null)
* @method \Nesk\Puphpeteer\Resources\ExecutionContext executionContext()
* @method mixed evaluateHandle(callable|string $pageFunction, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method mixed evaluate(mixed $pageFunction, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method string content()
* @method void setContent(string $html, array{ timeout: float, waitUntil: string|string[] } $options = null)
* @method string name()
* @method string url()
* @method \Nesk\Puphpeteer\Resources\Frame|null parentFrame()
* @method \Nesk\Puphpeteer\Resources\Frame[] childFrames()
* @method bool isDetached()
* @method \Nesk\Puphpeteer\Resources\ElementHandle addScriptTag(array<string, mixed> $options)
* @method \Nesk\Puphpeteer\Resources\ElementHandle addStyleTag(array<string, mixed> $options)
* @method void click(string $selector, array{ delay: float, button: mixed, clickCount: float } $options = null)
* @method void focus(string $selector)
* @method void hover(string $selector)
* @method string[] select(string $selector, string ...$values)
* @method void tap(string $selector)
* @method void type(string $selector, string $text, array{ delay: float } $options = null)
* @method \Nesk\Puphpeteer\Resources\JSHandle|null waitFor(string|float|callable $selectorOrFunctionOrTimeout, array<string, mixed> $options = null, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method void waitForTimeout(float $milliseconds)
* @method \Nesk\Puphpeteer\Resources\ElementHandle|null waitForSelector(string $selector, array<string, mixed> $options = null)
* @method \Nesk\Puphpeteer\Resources\ElementHandle|null waitForXPath(string $xpath, array<string, mixed> $options = null)
* @method \Nesk\Puphpeteer\Resources\JSHandle waitForFunction(callable|string $pageFunction, array<string, mixed> $options = null, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method string title()
*/
class Frame extends BasicResource
{
use AliasesSelectionMethods, AliasesEvaluationMethods;
Expand Down
15 changes: 15 additions & 0 deletions src/Resources/HTTPRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method string url()
* @method string resourceType()
* @method string method()
* @method string|null postData()
* @method array<string, string> headers()
* @method \Nesk\Puphpeteer\Resources\HTTPResponse|null response()
* @method \Nesk\Puphpeteer\Resources\Frame|null frame()
* @method bool isNavigationRequest()
* @method \Nesk\Puphpeteer\Resources\HTTPRequest[] redirectChain()
* @method array{ errorText: string }|null failure()
* @method void continue(mixed $overrides = null)
* @method void respond(mixed $response)
* @method void abort(mixed $errorCode = null)
*/
class HTTPRequest extends BasicResource
{
//
Expand Down
16 changes: 16 additions & 0 deletions src/Resources/HTTPResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method mixed remoteAddress()
* @method string url()
* @method bool ok()
* @method float status()
* @method string statusText()
* @method array<string, string> headers()
* @method \Nesk\Puphpeteer\Resources\SecurityDetails|null securityDetails()
* @method mixed buffer()
* @method string text()
* @method mixed json()
* @method \Nesk\Puphpeteer\Resources\HTTPRequest request()
* @method bool fromCache()
* @method bool fromServiceWorker()
* @method \Nesk\Puphpeteer\Resources\Frame|null frame()
*/
class HTTPResponse extends BasicResource
{
//
Expand Down
11 changes: 11 additions & 0 deletions src/Resources/JSHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method \Nesk\Puphpeteer\Resources\ExecutionContext executionContext()
* @method mixed evaluate(mixed|string $pageFunction, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method \Nesk\Puphpeteer\Resources\JSHandle|\Nesk\Puphpeteer\Resources\ElementHandle evaluateHandle(callable|string $pageFunction, int|float|string|bool|null|array|\Nesk\Puphpeteer\Resources\JSHandle ...$args)
* @method \Nesk\Puphpeteer\Resources\JSHandle|null getProperty(string $propertyName)
* @method array<string, \Nesk\Puphpeteer\Resources\JSHandle> getProperties()
* @method array<string, mixed> jsonValue()
* @method \Nesk\Puphpeteer\Resources\ElementHandle|null asElement()
* @method void dispose()
* @method string toString()
*/
class JSHandle extends BasicResource
{
//
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/Keyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method void down(mixed $key, array{ text: string } $options = null)
* @method void up(mixed $key)
* @method void sendCharacter(string $char)
* @method void type(string $text, array{ delay: float } $options = null)
* @method void press(mixed $key, array{ delay: float, text: string } $options = null)
*/
class Keyboard extends BasicResource
{
//
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/Mouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

use Nesk\Rialto\Data\BasicResource;

/**
* @method void move(float $x, float $y, array{ steps: float } $options = null)
* @method void click(float $x, float $y, array<string, mixed>&array{ delay: float } $options = null)
* @method void down(array<string, mixed> $options = null)
* @method void up(array<string, mixed> $options = null)
* @method void wheel(array<string, mixed> $options = null)
*/
class Mouse extends BasicResource
{
//
Expand Down
Loading

0 comments on commit 3aa9569

Please sign in to comment.